POD数据
来源:互联网 发布:js防水涂料使用方法 编辑:程序博客网 时间:2024/05/20 18:42
A POD-struct is an aggregate class that has no non-static data members of type pointer to member, non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-defined copy assignment operator and no user-defined destructor.
A POD-union is an aggregate union that has no non-static data members of type pointer to member, non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-defined copy assignment operator and no user-defined destructor.
A POD class is a class that is either a POD-struct or a POD-union.
POD结构(POD-struct)是一个聚合类,它没有以下类型的非静态数据成员:
指向成员的指针、非POD结构、非POD联合(或以上类型的数组),或它们的引用,
并且没有用户自定义的拷贝赋值运算符,也没有用户自定义的析构函数。
类似的,POD联合(POD-union)是一个聚合联合,
它没有以下类型的非静态数据成员:
指向成员的指针、非POD结构、非POD联合(或以上类型的数组),或它们的引用,
并且没有用户自定义的拷贝赋值运算符,也没有用户自定义的析构函数。
POD类(POD class)是一个类,它要么是POD结构,要么是POD联合。
以下几种是POD
1、所有基本数据类型
2、一个class或者struct,它不包含虚函数,没有虚基类,每一个数据成员都是POD,且所有的父类(如果存在的话)都是POD
3、POD数组
4、由POD组成的union
POD可以包含非虚成员函数,当然也可以包含构造函数和(非虚)析构函数,因为这些东东都不影响对象布局。
下面这个类,它不需要copy ctor就可以拷贝构造,但不是POD:
struct S
{
std::string str; // std::string内部有指针,使用memcpy时执行浅拷贝
};
- POD数据
- POD数据了解
- POD
- POD
- POD
- pod
- POD
- pod
- "POD" 类型
- POD驱动
- POD对象
- CPP POD
- pod 类型
- Perl POD
- POD 类型
- 什么是POD
- C++ POD
- POD数据类型
- Five Steps to Writing Windows Services in C
- 跑步的第三天
- Android应用程序的快速启动
- Java上机实现统计某一目录下每个文件中出现的字母个数、数字个数、空格个数及行数?
- 学习心得呀
- POD数据
- 神奇的汇编(四)
- c#开发移动彩信网关
- 台湾hadoop测试环境
- 阅读txt程序
- 自编桌面背景控制程序(替换掉desktop.htt)
- 程序员之路
- Creating a Simple Win32 Service in C++
- C#数据库编程 之 SQLHelper类