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. input keyup的时候实现内容过滤

    当在文本框中输入关键字,就会搜索出包含关键字的数据 实现: 只需要一个内容过滤即可 <body> <input type="text" id="sear ...

  2. day20 模块 collections time sys os

    1.模块 1. 模块的定义:我们把装有特定功能的代码进行归类的结果.我们目前写的所有py文件都是模块 2. 引入模块的方式: 1.import 模块名 2.from xxx import 模块名 2. ...

  3. linux系统延时和定时任务

    系统延时任务延时任务:只做一次的at命令: 系统定时及延时任务 延时任务:**有输出任务**不会输出到终端上而是发送邮件给你/var/mail/root/执行 mail at          时间 ...

  4. mybatis CDATA引起的查询失败

    <![CDATA[ ]]> 在被CDATA包围的所有字符串不会被mybatis解析, 直接写入sql了 CDATA应该只用在特殊字符前后,不能用在<if> <foreac ...

  5. python解决excel工作薄合并处理

    年度了,要对每个月的数据进行总的汇总,去计算每消耗品的使用情况,表格都在一个工作表的不同sheet中,并且格式相同,所以就用python写了这个小脚本,现在把脚本粘贴出来,以后有需要就可以在此基础上改 ...

  6. 时间复杂度——cin加速器

    static auto _=[]() { ios::sync_with_stdio(false); cin.tie(); ; }(); 代码简析:   cin,cout效率低是因为他们要将输入输出的数 ...

  7. Mybatis学习笔记1 - Hello World

    1.pom.xml文件 <?xml version="1.0" encoding="UTF-8"?> <project xmlns=" ...

  8. android通过Jni加载so库遇到UnsatisfiedLinkError问题!!!

    错误信息: java.lang.UnsatisfiedLinkError: hsl.p2pipcam.nativecaller.NativeCaller at hsl.p2pipcam.manager ...

  9. div拖动实现及优化

    工作中的一个项目ui界面比较传统(chou),就想着把前端重构一下.内容之一是把导航栏从上方固定高度改为了右侧伸缩的边栏,好处是边栏可伸缩,占用面积小.不完美的地方是有时候会遮挡页面上最右边的按钮,作 ...

  10. typescript的lambads解决this关键字找不到属性

    var people = { name: ["abc", "jack", "pepter", "jim"], getna ...