If I have two classes, inherited from each other, and are only class workers, memory layout will be Is the same for both classes?
For example
class base {int a, b, c; }; Category created: public base {// only function}; I have read that compiler data can not reorder members, and I do not need multiple-inheritance on the derived class. Is there a situation where memory layout will not be the same? (Multiple heritage may be required for the base class)
both base and derived here. Since the objective of the standard layout is to cooperate with other languages (most notably C), yes, you can consider the layout as equal for both. If you add multi-heritage to the mix, the result may be a standard layout class or. You can see the rules for this in the link above.
Comments
Post a Comment