c++ data alignment /member order & inheritance

后端 未结 9 1649
礼貌的吻别
礼貌的吻别 2020-11-29 01:34

How do data members get aligned / ordered if inheritance / multiple inheritance is used? Is this compiler specific?

Is there a way to specify in a derived class how

9条回答
  •  暖寄归人
    2020-11-29 02:21

    As soon as your class is not POD (Plain old data) all bets are off. There are probably compiler-specific directives you can use to pack / align data.

提交回复
热议问题