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:
“The aggregate of all knowledge has not yet become culture in us. Rather it would seem as if, with the progressive scientific penetration and dissection of reality, the foundations of our thinking grow ever more precarious and unstable.”
—Johan Huizinga (18721945)
“Whats the greatest enemy of Christianity to-day? Frozen meat. In the past only members of the upper classes were thoroughly sceptical, despairing, negative. Why? Among other reasons, because they were the only people who could afford to eat too much meat. Now theres cheap Canterbury lamb and Argentine chilled beef. Even the poor can afford to poison themselves into complete scepticism and despair.”
—Aldous Huxley (18941963)