c++的POD数据类型
来源:互联网 发布:用友nc java插件 编辑:程序博客网 时间:2024/05/29 18:59
1.1 c++的POD数据类型
POD: plain old data的缩写。
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.
POD类型的c++特性:
1、布局
POD对象的内存字节是连续的。
2 初始化
1)如果定义一个非常量的POD对象,没有进行初始化,这个对象将会有一个不确定的初始值。
2)POD类型的缺省初始化是0初始化。
3)如果对一个静态的POD对象进行初始化,
如果是局部静态对象,那么初始值是在第一次执行初始化语句块的时候设定如果是全局静态对象,那么初始值是在任何动态初始化之前设定。
3 拷贝
POD类型的对象可以copy
4 Addressing
The address of a POD object can be an address constant expression (or part of one) [§5.19, ¶4], while a reference to a POD member can be a reference constant expression 。
"A pointer to a POD-struct object, suitably converted using a reinterpret_cast, points to its initial member ... and vice versa"- c++的POD数据类型
- POD数据类型
- 【C++进阶】C++的POD数据类型
- C++11:POD数据类型
- 【C++11】POD数据类型
- C++11:POD数据类型
- C++之POD数据类型
- 什么是POD数据类型?
- 什么是POD数据类型?
- c++POD 简介
- [C++]什么是POD?
- 制作 Swift 和 Objective-C Mixed 的 Pod
- pod install 与 pod update的区别
- Pod 更新出现pod.lock的问题
- pod install与pod update的区别
- CocoaPods - pod install ,pod update的用法
- pod install & pod update 的区别
- C#的数据类型
- 解决此类问题:warning: unable to bind to property '' on class 'Object' (class is not an IEventDispatcher) .
- 收藏PHP常用函数
- FTK应用程序编程接口(API)手册
- 《程序员》2011年第8期精彩内容导读:海量数据
- java正则表达式的一些知识点
- c++的POD数据类型
- wireshark开发者手册中文版——如何窃听协议
- Ubuntu Windows Android SDK 源码下载及配置
- SQL Server中的convert来转换时间
- hi
- 一道简单的面试题(求较小的值,不能用 比较运算符 if-else ?: while for 内嵌汇编 递归 第三方函数)(zt)
- Jexus V4.3 正式发布
- sql server 自增列
- poj 3278 Catch That Cow