c ++初学者的新术语?

yes*_*aaj 1 c++ pod

POD类型是什么意思?cv-qualified?

CMS*_*CMS 8

POD,Plain Old Data,是C中具有等价物的任何C++类型.

cv-qualified type是一种已被限定为const或volatile的类型.

// non cv_qualified
int one; 
char *two; 

// cv-qualified 
const int three; 
volatile char * four; 
Run Code Online (Sandbox Code Playgroud)

POD类型的数据成员必须是公共的,并且可以是任何基本类型:bool,数字类型,枚举类型,数据指针类型,指向函数类型,以及任何前面的数组.

struct A //POD
{
 int n;
 double y;
};

struct B //non-POD
{
private:
 int n;
 double y;
};
Run Code Online (Sandbox Code Playgroud)


Sta*_*kii 5

POD代表Plain Old Data类型.它通常指的是用于保存数据和访问器的类 - 没有别的.还暗示该函数没有vtable,这意味着该类没有多态成员.这些对于轻量级对象很受欢迎,您不希望为多态类开销付出代价.

CV合格. C = Const,V =挥发性.