c**********e 发帖数: 2007 | 1 class A {
public:
~A() {}
int a; int b;
}
Which statement about the sample code above is correct?
a) It is an aggregate, but not a POD (Plain Old Datatype).
b) It is just a POD.
c) It is both a POD and an aggregate.
d) It cannot be initialized because there are no constructors.
e) It cannot be initialized as an array element because there is no default
constructor. |
E*U 发帖数: 2028 | 2 a
【在 c**********e 的大作中提到】 : class A { : public: : ~A() {} : int a; int b; : } : Which statement about the sample code above is correct? : a) It is an aggregate, but not a POD (Plain Old Datatype). : b) It is just a POD. : c) It is both a POD and an aggregate. : d) It cannot be initialized because there are no constructors.
|
c**********e 发帖数: 2007 | 3 You are right!
A POD is always an aggregate. A POD can not have user defined destructor or
user-defined copy assignment operator.
【在 E*U 的大作中提到】 : a
|