由买买提看人间百态

topics

全部话题 - 话题: q06
(共0页)
c**********e
发帖数: 2007
1
来自主题: Programming版 - C++ Q06: POD versus Aggregate-type
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
来自主题: Programming版 - C++ Q06: POD versus Aggregate-type
a
c**********e
发帖数: 2007
3
来自主题: Programming版 - C++ Q06: POD versus Aggregate-type
You are right!
A POD is always an aggregate. A POD can not have user defined destructor or
user-defined copy assignment operator.
(共0页)