Type support (basic types, RTTI, type traits)

来自cppreference.com
< cpp

 
 
实用工具库
类型的支持 (basic types, RTTI, type traits)
动态内存管理
错误处理
程序实用工具
可变参数函数
日期和时间
函数对象
initializer_list(C++11)
bitset
hash(C++11)
关系运算符
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
双和元组
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
掉期,远期和移动
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
类型的支持
基本类型
Original:
Basic types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
基本类型
固定宽度的整数类型 (C++11)
nullptr_t(C++11)
offsetof
NULL
数值范围内
Original:
Numeric limits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
numeric_limits
C数字限制接口
运行时类型信息
Original:
Runtime type information
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
type_info
type_index(C++11)
类型特征
Original:
Type traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
初级型两类
Original:
Primary type categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_void(C++11)
is_array(C++11)
is_pointer(C++11)
is_enum(C++11)
is_union(C++11)
is_class(C++11)
is_function(C++11)
is_object(C++11)
is_scalar(C++11)
is_compound(C++11)
is_integral(C++11)
is_floating_point(C++11)
is_fundamental(C++11)
is_arithmetic(C++11)
is_reference(C++11)
is_lvalue_reference(C++11)
is_rvalue_reference(C++11)
is_member_pointer(C++11)
is_member_object_pointer(C++11)
is_member_function_pointer(C++11)
类型属性
Original:
Type properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_const(C++11)
is_volatile(C++11)
is_pod(C++11)
is_empty(C++11)
is_polymorphic(C++11)
is_abstract(C++11)
is_trivial(C++11)
is_trivially_copyable(C++11)
is_standard_layout(C++11)
is_literal_type(C++11)
is_signed(C++11)
is_unsigned(C++11)
支持的操作
Original:
Supported operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_constructible
is_trivially_constructible
is_nothrow_constructible
(C++11)
(C++11)
(C++11)
is_default_constructible
is_trivially_default_constructible
is_nothrow_default_constructible
(C++11)
(C++11)
(C++11)
is_copy_constructible
is_trivially_copy_constructible
is_nothrow_copy_constructible
(C++11)
(C++11)
(C++11)
is_move_constructible
is_trivially_move_constructible
is_nothrow_move_constructible
(C++11)
(C++11)
(C++11)
is_assignable
is_trivially_assignable
is_nothrow_assignable
(C++11)
(C++11)
(C++11)
is_copy_assignable
is_trivially_copy_assignable
is_nothrow_copy_assignable
(C++11)
(C++11)
(C++11)
is_move_assignable
is_trivially_move_assignable
is_nothrow_move_assignable
(C++11)
(C++11)
(C++11)
is_destructible
is_trivially_destructible
is_nothrow_destructible
(C++11)
(C++11)
(C++11)
has_virtual_destructor(C++11)
关系和属性查询
Original:
Relationships and property queries
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
is_same(C++11)
is_base_of(C++11)
is_convertible(C++11)
alignment_of(C++11)
rank(C++11)
extent(C++11)
类型的修改
Original:
Type modifications
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
remove_cv
remove_const
remove_volatile
(C++11)
(C++11)
(C++11)
add_cv
add_const
add_volatile
(C++11)
(C++11)
(C++11)
make_signed(C++11)
make_unsigned(C++11)
remove_reference(C++11)
add_lvalue_reference
add_rvalue_reference
(C++11)
(C++11)
remove_pointer(C++11)
add_pointer(C++11)
remove_extent(C++11)
remove_all_extents(C++11)
类型转换
Original:
Type transformations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
aligned_storage(C++11)
aligned_union(C++11)
decay(C++11)
enable_if(C++11)
conditional(C++11)
common_type(C++11)
underlying_type(C++11)
result_of(C++11)
键入特征常数
Original:
Type trait constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
integral_constant(C++11)
 

目录

[编辑] 基本类型

[编辑] 基本类型定义的语言

[编辑] 其他的基本类型和宏

Defined in header <cstddef>
返回无符号整数类型的sizeof运营商
Original:
unsigned integer type returned by the sizeof operator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(的typedef) [edit]
符号的整数类型时,返回两个指针相减
Original:
signed integer type returned when subtracting two pointers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(的typedef) [edit]
(C++11)
类型的文字nullptr空指针
Original:
the type of the null pointer literal nullptr
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(的typedef) [edit]
实现定义的空指针常量
Original:
implementation-defined null pointer constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(宏不变) [edit]
(C++11)
POD类型的对齐要求大,任何其他标​​量类型
Original:
POD type with alignment requirement as great as any other scalar type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(的typedef) [edit]
一个标准的布局类型指定的成员从一开始的字节偏移量
Original:
byte offset from the beginning of a standard-layout type to specified member
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函数宏) [edit]
Defined in header <cstdbool>
__bool_true_false_are_defined
(C++11)
C的兼容性宏不变,扩展到整数常量1
Original:
C compatibility macro constant, expands to integer constant 1
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(宏不变)
Defined in header <cstdalign>
__alignas_is_defined
(C++11)
C的兼容性宏不变,扩展到整数常量1
Original:
C compatibility macro constant, expands to integer constant 1
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(宏不变)

[编辑] 固定宽度的整数类型 (C++11 起)

[编辑] numeric_limits

Defined in header <limits>
提供了一个接口的所有基本数字类型的查询性能.
Original:
provides an interface to query properties of all fundamental numeric types.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]

[编辑] C数字限制接口

[编辑] 运行时类型识别

包含某些类型的信息,这是类的implementation.
产生的,由typeid的运算符返回
Original:
contains some type's information, generated by the implementation.
This is the class, returned by the typeid的 operator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
(C++11)
包装周围的type_info对象,可以作为指数的关联和无序关联式容器
Original:
wrapper around a type_info object, that can be used as index in associative and unordered associative containers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
typeid的表达引发的异常如果有一个参数为空
Original:
exception that is thrown if an argument in a typeid的表达 is null
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
被抛出的异常的无效dynamic_cast表达,即引用类型的强制转换失败
Original:
exception that is thrown by an invalid dynamic_cast expression, i.e. a cast of reference type fails
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]

[编辑] 型性状NJ

类型特征定义了一个基于模板的编译时间接口来查询或修改属性的类型.
Original:
Type traits defines an compile-time template-based interface to query or modify the properties of types.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 类型属性

Defined in header <type_traits>
初级型两类
Original:
Primary type categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
如果一个类型的检查是void
Original:
checks if a type is void
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
检查如果一个类型是整数类型
Original:
checks if a type is integral type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
检查如果一个类型是浮点型
Original:
checks if a type is floating-point type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
检查如果一个类型是数组类型
Original:
checks if a type is an array type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
检查如果一个类型是一个枚举类型
Original:
checks if a type is an enumeration type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
检查如果一个类型是一个联合类型
Original:
checks if a type is an union type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
checks if a type is a class type (but not union type)
(类模板) [edit]
(C++11)
如果一个类型的检查是函数类型
Original:
checks if a type is a function type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
检查如果一个类型是一个指针类型
Original:
checks if a type is a pointer type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
检查如果一个类型是“左值参考”
Original:
checks if a type is lvalue reference
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
检查,如果一个类型是“右值引用”
Original:
checks if a type is rvalue reference
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
检查如果一个类型是一个指针,指向一个非静态成员对象
Original:
checks if a type is a pointer to a non-static member object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
如果一个类型的检查是一个非静态成员函数的指针
Original:
checks if a type is a pointer to a non-static member function
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
复合型两类
Original:
Composite type categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
检查如果一个类型是基本类型
Original:
checks if a type is fundamental type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
如果一个类型的检查是算术型
Original:
checks if a type is arithmetic type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
如果一个类型的检查是标量类型
Original:
checks if a type is scalar type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
如果一个类型的检查对象的类型
Original:
checks if a type is object type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
检查如果一个类型是复合型
Original:
checks if a type is compound type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
如果一个类型的检查是“左值引用”或“右值引用'
Original:
checks if a type is either lvalue reference or rvalue reference
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
checks if a type is a pointer to a non-static member function or object
(类模板) [edit]
类型属性
Original:
Type properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
检查如果一个类型是const限定
Original:
checks if a type is const-qualified
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
类型检查,如果是挥发合格的
Original:
checks if a type is volatile-qualified
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
如果一个类型的检查是微不足道的
Original:
checks if a type is trivial
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
checks if a type is trivially copyable
(类模板) [edit]
检查如果一个类型是标准的布局类型
Original:
checks if a type is standard-layout type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
检查如果一个类型是普通的旧数据(POD)类型
Original:
checks if a type is plain-old data (POD) type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
checks if a type is literal type
(类模板) [edit]
(C++11)
checks if a type is class (but not union) type and has no data
(类模板) [edit]
(C++11)
检查如果一个类型是多态类的类型
Original:
checks if a type is polymorphic class type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
检查如果一个类型是一个抽象类类型
Original:
checks if a type is abstract class type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
检查
Original:
checks if a type is signed arithmetic type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
如果一个类型的检查是无符号的算术类型
Original:
checks if a type is unsigned arithmetic type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
支持的操作
Original:
Supported operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
检查如果一个类型有一个构造函数的具体参数
Original:
checks if a type has a constructor for specific arguments
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
检查如果一个类型有一个默认的构造函数
Original:
checks if a type has a default constructor
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
一类的检查,如果有拷贝构造函数
Original:
checks if a type has a copy constructor
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
类型检查,如果有一个移动的构造函数
Original:
checks if a type has a move constructor
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
如果一个类型的检查有特定参数的赋​​值操作符
Original:
checks if a type has a assignment operator for a specific argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
检查如果一个类型有一个拷贝赋值运算符
Original:
checks if a type has a copy assignment operator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
一类的检查,如果有一招赋值运算符
Original:
checks if a type has a move assignment operator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
如果一个类型的检查,具有不可删除的析构函数
Original:
checks if a type has a non-deleted destructor
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
一类的检查,如果有虚析构函数
Original:
checks if a type has a virtual destructor
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
属性查询
Original:
Property queries
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
获得该类型的对齐要求
Original:
obtains the type's alignment requirements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
获得一个数组类型的尺寸
Original:
obtains the number of dimensions of an array type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
获得一个数组类型的大小,沿着指定的尺寸
Original:
obtains the size of an array type along a specified dimension
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
类型之间的关系
Original:
Type relationships
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
两种类型的检查,如果是相同的
Original:
checks if two types are the same
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
checks if a type is derived from the other type
(类模板) [edit]
(C++11)
如果一个类型的检查,可以被转换成另一种类型
Original:
checks if a type can be converted to the other type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]

[编辑] 类型的修改

类型修改模板创建新的类型定义通过应用模板参数的修改。类型可以通过访问type成员typedef.
Original:
Type modification templates create new type definitions by applying modifications on a template parameter. The resulting type can then be accessed through type member typedef.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <type_traits>
常量波动符
Original:
Const-volatility specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
移除const和/或volatile从给定的类型说明符
Original:
removes const or/and volatile specifiers from the given type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
(C++11)
(C++11)
adds const or/and volatile specifiers to the given type
(类模板) [edit]
参考文献
Original:
References
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
移除参考给定的类型
Original:
removes reference from the given type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
增加了“左值”或“右值”参考给定类型
Original:
adds lvalue or rvalue reference to the given type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
指针
Original:
Pointers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
移除从给定类型的指针
Original:
removes pointer from the given type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
添加到给定的类型的指针
Original:
adds pointer to the given type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
注册改性剂
Original:
Sign modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
整体式签署
Original:
makes the given integral type signed
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
整体式无符号
Original:
makes the given integral type unsigned
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
阵列
Original:
Arrays
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
删除一个程度上给定的数组类型
Original:
removes one extent from the given array type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
removes all extents from the given array type
(类模板) [edit]

[编辑] 其他的转换

Defined in header <type_traits>
(C++11)
定义的类型适合用作未初始化的存储类型的给定尺寸
Original:
defines the type suitable for use as uninitialized storage for types of given size
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
适合所有类型的使用未初始化的存储定义的类型
Original:
defines the type suitable for use as uninitialized storage for all given types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
适用于当一个函数传递参数的值的类型转换
Original:
applies type transformations as when passing a function argument by value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
隐藏的功能过载或编译时布尔基于模板专业化
Original:
hides a function overload or template specialization based on compile-time boolean
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
选择一种或另一种编译型布尔的基础上
Original:
chooses one type or another based on compile-type boolean
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
deduces the result type of a mixed-mode arithmetic expression
(类模板) [edit]
(C++11)
获得一个给定的枚举类型的底层整数类型
Original:
obtains the underlying integer type for a given enumeration type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
(C++11)
推导出的返回类型的函数调用表达式
Original:
deduces the return type of a function call expression
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]

[编辑] Helper类

Defined in header <type_traits>
编译时指定类型的指定的值保持不变
Original:
compile-time constant of specified type with specified value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
std::integral_constant的类型bool两个专业
Original:
Two specializations of std::integral_constant for the type bool are provided:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <type_traits>
类型
Original:
Type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
true_type std::integral_constant<bool, true>
false_type std::integral_constant<bool, false>