logoalt Hacker News

o11cyesterday at 7:02 PM1 replyview on HN

For layout-compatible types, you can often just include a `_base` member in each child. Maybe twice (once named and once unnamed) to avoid excess typing - I don't understand the common-initial-subsequence rule but people do this enough that compilers have to allow it.


Replies

manwe150today at 3:43 PM

I don't think compilers typically allow that: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14319