Plain old data structure

来源:互联网 发布:金钥匙软件 编辑:程序博客网 时间:2024/06/06 18:02

From Wikipedia

A plain old data structure (POD) is a data structure that is represented only as passive collections of field values, without using encapsulation  or other object-oriented features.

A POD type in C++  is defined as either a scalar type or a POD class. POD class has no user-defined copy assignment operator, no user-defined destructor, and no non-static data members that are not themselves PODs. Moreover, POD class must be an aggregate, meaning it has no user-declared constructors, no private nor protected non-static data, no bases and no virtual functions. The standard includes statements about how PODs must behave in C++.

原创粉丝点击