Reputation: 1057
According to wikipedia a requirement for "standard-layout" is:
Does not that preclude objects with public methods and private data from ever being standard-layout? What is the rationale for such a draconian rule?
Upvotes: 4
Views: 201
Reputation: 99044
Does not that preclude objects with public methods and private data from ever being standard-layout?
No, the Wikipedia article has had the wrong wording. Only different access control for data members is mentioned in §9/6 of the FCD, which treats standard-layout:
A standard-layout class is a class that:
[...]
— has the same access control (Clause 11) for all non-static data members,
Upvotes: 3