Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
根据当前的 C++ 标准草案,一个标准布局类
要么在派生最多的类中没有非静态数据成员,并且最多有一个具有非静态数据成员的基类,要么没有具有非静态数据成员的基类
我还没有看到任何在这个限制下会更有效的实现。它为什么存在(除了让事情变得更困难)?
标准布局的目的不是效率,它与 C 的数据互操作性