其他分享
首页 > 其他分享> > C中的POD类型是什么?

C中的POD类型是什么?

作者:互联网

我有几次遇到这个术语POD型.
这是什么意思?

解决方法:

POD代表普通旧数据 – 即没有构造函数,析构函数和虚拟成员函数的类(无论是使用关键字struct还是关键字类定义). 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,types,c-faq
来源: https://codeday.me/bug/20190910/1802314.html