Aggregate Classes
An aggregate class is a class with no user-declared constructors, no private or protected non-static data members, no base classes, and no virtual functions. Such a class can be initialized with a brace-enclosed comma-separated list of initializer-clauses. The following code has the same semantics in both C and C++.
struct C { int a; double b; }; struct D { int a; double b; C c; }; // initialize an object of type C with an initializer-list C c = {1, 2.0}; // D has a sub-aggregate of type C. In such cases initializer-clauses can be nested D d = {10, 20.0, {1, 2.0}};Read more about this topic: C++ Classes
Famous quotes containing the words aggregate and/or classes:
“We cannot think of a legitimate argument why ... whites and blacks need be affected by the knowledge that an aggregate difference in measured intelligence is genetic instead of environmental.... Given a chance, each clan ... will encounter the world with confidence in its own worth and, most importantly, will be unconcerned about comparing its accomplishments line-by-line with those of any other clan. This is wise ethnocentricism.”
—Richard Herrnstein (19301994)
“By his very success in inventing labor-saving devices, modern man has manufactured an abyss of boredom that only the privileged classes in earlier civilizations have ever fathomed.”
—Lewis Mumford (18951990)