Empty Base Optimisation MSVC
Empty base optimisation with multiple inheritance appears still to be broken in msvc++ 2010. Currently, it appears to only work for the first type derived from, so if you are deriving from multiple empty bases the child type ends up with more bytes (just useless padding!) than it needs.
Apparently it's been this way for some time: https://connect.microsoft.com/VisualStudio/feedback/details/100686/empty-member-optimization-not-working-properly
This link is marked "closed - not to be fix开发者_运维问答ed". Just wondering if anyone knew if there's anything happening with this "feature" these days??
Empty base optimisation with multiple inheritance appears still to be broken in msvc++ 2010
What do you mean by "broken"? That, it is not Standard conformant?
The Standard doesn't require empty classes to have zero size when deriving from them. An implementation may choose to optimize this or it may not at all.
精彩评论