我曾多次遇到过 POD-type 这个术语。
这是什么意思?
最佳答案
POD 代表 Plain Old Data - 即一个类(无论是使用关键字 struct
还是关键字 class
) 没有构造函数、析构函数和虚成员函数。 Wikipedia's article on POD更详细一点并将其定义为:
A Plain Old Data Structure in C++ is an aggregate class that contains only PODS as members, has no user-defined destructor, no user-defined copy assignment operator, and no nonstatic members of pointer-to-member type.
更多详情请见 this answer for C++98/03 . C++11 改变了围绕 POD 的规则,大大放松了它们,因此 necessitating a follow-up answer here .
关于c++ - C++ 中的 POD 类型是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/146452/