C ++ 0x "standard layout"

According to wikipedia , the requirement for a "standard layout":

  • Has the same access control (open, closed, protected) for all non-static members

Does the standard layout exclude objects with public methods and private data? What is the rationale for such a draconian rule?

+4
source share
1 answer

Does this exclude that objects with public methods and private data become standard?

No, the Wikipedia article is incorrectly worded . Section 9/6 of the FCD mentions only another access control for data members that considers the standard layout:

A standard layout class is a class that:
[...]
- has the same access control (section 11) for all non-static data elements ,

+3
source

Source: https://habr.com/ru/post/1332609/


All Articles