> … a technique called "subtyping" is used, where struct B, who's first member is a struct A, is cast as that struct A to properly conform to an interface. It's supposedly common in C (that's what I was told in #hare, anyway), though this is the first time I'm encountering it.
How much C have you looked at if you’ve never seen that pattern (or ‘story’, not up on the lingo)?
Is there another way to do this I’m not aware of because it’s so common I thought it was just common.
—edit—
Thinking about this for a minute there’s another ‘story’ where you use the least significant bit(s) as a tag and use that to differentiate between object types but that is definitely not too common, this hextree library I found somewhere uses it to tell a leaf from a branch and I’m really tempted to just replace it with the previously mentioned ‘subtyping’.