POD( Plain Old Data)概念:

Arithmetic types (3.9.1), enumeration types, pointer types, and pointer to member types (3.9.2), and cv-qualified(注2) versions of these types (3.9.3) are collectively called scalar types. Scalar types, POD-struct types,POD-union types (clause 9), arrays of such types and cv-qualified versions of these types (3.9.3) are collectively called POD types. 
 
如果一个class没有non-trivial 的 constructor, destructor, 以及 copy assignmet operator这些东西的话,这个class事实上已经退化成一个POD类型了,就相当于C中的struct。
 
POD类型包括下面类型:
1、标量类型,c/c++的基本类型
  • signed integer types (signed char, short, int, long),
  • unsigned integer types (unsigned char,unsigned short, unsigned int,unsigned long),
  • char and wchar_t, and
  • bool.
  • float, double, and long double
  • pointer-to-void (void *),
  • pointer-to-object and pointer-to-static-member-data (both of the form T* when pointing to an object of typeT), and
  • pointer-to-function and pointer-to-static-member-function (both of the form T (*)(...) when pointing to a function that returns an object of typeT).
  • pointer-to-nonstatic-member-data (of the form T C::* when pointing to one of classC's data members that has type T), and
  • pointer-to-nonstatic-member-functions (of the form T (C::*)(...) when pointing to one of classC's member functions that returns an object of typeT).
2、用户自定义的类类型:
  • non-static data (including arrays) of any pointer-to-member type,
  • non-static data (including arrays) of any non-POD class type,
  • non-static data of any reference type,
  • user-defined copy assignment operator, nor
  • user-defined destructor.
  • user-declared constructors,
  • private or protected non-static data members,
  • base classes, nor
  • virtual functions.

C++ POD类型的更多相关文章

  1. c++11 pod类型(了解)

    啥是POD类型? POD全称Plain Old Data.通俗的讲,一个类或结构体通过二进制拷贝后还能保持其数据不变,那么它就是一个POD类型. 平凡的定义 .有平凡的构造函数 .有平凡的拷贝构造函数 ...

  2. C++ trivial和non-trivial构造函数及POD类型(转)

    原博客地址http://blog.csdn.net/a627088424/article/details/48595525 最近正纠结这个问题就转过来了,做了点补充(参考<深度探索C++对象模型 ...

  3. 关于POD和非POD类型中,list initialization和constructor initialization(未解决)

    如果你的成员是POD类型的,那么list initialization和constructor initialization没有任何区别 #include<iostream> using ...

  4. C++11 POD类型

    POD,全称plain old data,plain代表它是一个普通类型,old代表它可以与c兼容,可以使用比如memcpy()这类c中最原始函数进行操作.C++11中把POD分为了两个基本概念的集合 ...

  5. POD类型

    POD类型 POD全称Plain Old Data.通俗的讲,一个类或结构体通过二进制拷贝后还能保持其数据不变,那么它就是一个POD类型. C++11将POD划分为两个基本概念的合集,即:平凡的和标准 ...

  6. 3. C++ POD类型

    POD全称Plain Old Data,通常用于说明1个类型的属性.通俗的讲,一个类或结构体通过二进制拷贝后还能保持其数据不变,那么它就是一个POD类型. C++11将POD划分为2个基本概念的合集, ...

  7. 关于C++ 中POD类型的解析

    转自: http://liuqifly.spaces.live.com/blog/cns!216ae3a149106df9!221.entry (C++-98:1.8;5)给出的定义:将对象的各字节拷 ...

  8. 聚合类型与POD类型

    Lippman在<深度探索C++对象模型>的前言中写道: I have heard a number of people over the years voice opinions sim ...

  9. C++ POD 类型

    POD 是 C++ 中一个比较重要的概念,POD 是英文 Plain Old Data 的缩写(通俗讲就是类或结构体通过二进制拷贝后还能保持其数据不变),用来描述一个类型(包括 class.union ...

随机推荐

  1. mybatis mapper问题列表

    id出现两次 2018-11-14 16:15:03.833 DEBUG 41432 --- [           main] c.a.i.o.d.mapper.DatvMapper.insert  ...

  2. 分治法 - Divide and Conquer

    在计算机科学中,分治法是一种很重要的算法.分治法即『分而治之』,把一个复杂的问题分成两个或更多的相同或相似的子问题,再把子问题分成更小的子问题……直到最后子问题可以简单的直接求解,原问题的解即子问题的 ...

  3. css预处理器 sass和stylus对比以及常用功能

    在众多的css预处理器语言中,sass和stylus算是十分优秀的两个.本文主要针对两者的常用功能做个简单的对比分析.在对比中了解二者的差异,同时帮助大家更好的掌握这两种预处理语言. 本文涉及到的sa ...

  4. Maven使用之packing篇

    项目的打包类型:pom.jar.war 项目中一般使用maven进行模块管理,每个模块下对应都有一个pom文件,pom文件中维护了各模块之间的依赖和继承关系.项目模块化可以将通用的部分抽离出来,方便重 ...

  5. Python查看类或Module的版本号

    >>> import keras >>> print keras.__version__ 1.2.0

  6. Murano Weekly Meeting 2016.08.02

    Meeting time: 2016.August.02 1:00~2:00 Chairperson:  Valerii Kovalchuk, from Mirantis Meeting summar ...

  7. (转)CentOS下的trap命令

    trap命令用于指定在接收到信号后将要采取的动作.常见的用途是在脚本程序被中断时完成清理工作.不过,这次我遇到它,是因为客户有个需求:从终端访问服务器的用户,其登陆服务器后会自动运行某个命令,例如打开 ...

  8. (转)Shell脚本之break,continue,和exit区别

    Linux脚本中的break continue exit return break结束并退出循环 continue在循环中不执行continue下面的代码,转而进入下一轮循环 exit退出脚本,常带一 ...

  9. PHP+jQuery实现翻板抽奖(中奖概率算法)

    在电视节目中有一种抽奖形式暂且叫做翻板抽奖,台上有一个墙面,墙面放置几个大方块,主持人或者抽奖者翻开对应的方块即可揭晓中奖结果.类似的抽奖形式还可以应用在WEB中,本文将使用PHP+jQuery为您讲 ...

  10. 斗鱼扩展--localStorage备份与导出(九)

    之前我们都把数据 放在了 localStorage 里,但扩展一旦卸载,数据就会被清空, 在Console里备份,一次只能输出一条,小白操作起来很不方便,所以能不能 导入,导出文件来进行备份还原呢? ...