Found in 1 comment on Hacker News
twoodfin · 2020-07-19 · Original thread
This is exactly how C++ structures single-inheritance types without virtual member functions.

Supporting virtual member functions (i.e. runtime polymorphism) only requires adding a vtable pointer—which IIRC Linux also does for some of its own structural subtyping, at least in its Virtual File System component.

Multiple inheritance requires some more bookkeeping by the compiler of appropriate offsets, but structurally it doesn't change very much.

It's not surprising: C++ was famously originally implemented as a preprocess transformation into C. Inside the C++ Object Model[1] is a fascinating deep dive on how C++ semantics map to C constructs.

[1] https://www.oreilly.com/library/view/inside-the-c/0201834545...