이름공간
변수
행위

Type support (basic types, RTTI, type traits)

cppreference.com
< cpp
 
 
 
Type support
Basic types
Fundamental types
Fixed width integer types (C++11)
Numeric limits
numeric_limits
C numeric limits interface
Runtime type information
Type traits
Primary type categories
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)
Type properties
is_const(C++11)
is_volatile(C++11)
is_pod(C++11)
is_empty(C++11)
is_polymorphic(C++11)
is_abstract(C++11)
Supported operations
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)
Relationships and property queries
is_same(C++11)
is_base_of(C++11)
is_convertible(C++11)
alignment_of(C++11)
rank(C++11)
extent(C++11)
Type modifications
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)
Type transformations
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)
Type trait constants
integral_constant(C++11)
 

목차

[편집] Basic types

[편집] Fundamental types defined by the language

[편집] Additional basic types and macros

<cstddef> 헤더에 정의되어 있음.
sizeof 연산에 의해 리턴되는 부호없는 정수형 타입이다.
(typedef) [edit]
두 포인터의 차연산에 의해 반환되는 부호있는 정수형
(typedef) [edit]
(C++11)
널 포인터 리터럴인 nullptr 의 형
(typedef) [edit]
구현에서 정의한 널 포인터 상수
(macro constant) [edit]
POD type with alignment requirement as great as any other scalar type
(typedef) [edit]
byte offset from the beginning of a standard-layout type to specified member
(function macro) [edit]
<cstdbool> 헤더에 정의되어 있음.
__bool_true_false_are_defined
(C++11)
C compatibility macro constant, expands to integer constant 1
(macro constant)
<cstdalign> 헤더에 정의되어 있음.
__alignas_is_defined
(C++11)
C compatibility macro constant, expands to integer constant 1
(macro constant)

[편집] Fixed width integer types (since C++11)

[편집] numeric_limits

<limits> 헤더에 정의되어 있음.
모든 기본 숫자형의 속성을 확인하는 인터페이스를 제공한다.
(class template) [edit]

[편집] C numeric limits interface

[편집] Runtime type identification

contains some type's information, generated by the implementation.
This is the class, returned by the typeid operator
(class) [edit]
wrapper around a type_info object, that can be used as index in associative and unordered associative containers
(class) [edit]
typeid 의 인자가 널이면 발생하는 예외이다.
(class) [edit]
유효하지 않은 dynamic_cast 표현에 의해 발생하는 예외이다. 즉, 참조형 변환의 실패를 말한다.
(class) [edit]

[편집] Type traits (since C++11)

Type traits defines an compile-time template-based interface to query or modify the properties of types.

[편집] Type properties

<type_traits> 헤더에 정의되어 있음.
Primary type categories
(C++11)
void형 인지 검사
(class template) [edit]
정수형 인지 검사
(class template) [edit]
부동소수점형 인지 검사
(class template) [edit]
(C++11)
배열형 인지 검사
(class template) [edit]
(C++11)
열거형 인지 검사
(class template) [edit]
(C++11)
공용체 인지 검사
(class template) [edit]
(C++11)
공용체가 아닌 클래스형 인지 검사
(class template) [edit]
함수형 인지 검사
(class template) [edit]
포인터형 인지 검사
(class template) [edit]
좌측값 참조 인지 검사
(class template) [edit]
우측값 참조 인지 검사
(class template) [edit]
비정적 멤버 객체의 포인터형 인지 검사
(class template) [edit]
비정적 멤버 함수의 포인터형 인지 검사
(class template) [edit]
Composite type categories
기본형 인지 검사
(class template) [edit]
checks if a type is arithmetic type
(class template) [edit]
(C++11)
checks if a type is scalar type
(class template) [edit]
(C++11)
checks if a type is object type
(class template) [edit]
checks if a type is compound type
(class template) [edit]
checks if a type is either lvalue reference or rvalue reference
(class template) [edit]
checks if a type is a pointer to a non-static member function or object
(class template) [edit]
Type properties
(C++11)
checks if a type is const-qualified
(class template) [edit]
checks if a type is volatile-qualified
(class template) [edit]
checks if a type is trivial
(class template) [edit]
checks if a type is trivially copyable
(class template) [edit]
checks if a type is standard-layout type
(class template) [edit]
(C++11)
checks if a type is plain-old data (POD) type
(class template) [edit]
checks if a type is literal type
(class template) [edit]
(C++11)
checks if a type is class (but not union) type and has no data
(class template) [edit]
checks if a type is polymorphic class type
(class template) [edit]
checks if a type is abstract class type
(class template) [edit]
(C++11)
checks if a type is signed arithmetic type
(class template) [edit]
checks if a type is unsigned arithmetic type
(class template) [edit]
Supported operations
checks if a type has a constructor for specific arguments
(class template) [edit]
checks if a type has a default constructor
(class template) [edit]
checks if a type has a copy constructor
(class template) [edit]
checks if a type has a move constructor
(class template) [edit]
checks if a type has a assignment operator for a specific argument
(class template) [edit]
checks if a type has a copy assignment operator
(class template) [edit]
checks if a type has a move assignment operator
(class template) [edit]
checks if a type has a non-deleted destructor
(class template) [edit]
checks if a type has a virtual destructor
(class template) [edit]
Property queries
obtains the type's alignment requirements
(class template) [edit]
(C++11)
obtains the number of dimensions of an array type
(class template) [edit]
(C++11)
obtains the size of an array type along a specified dimension
(class template) [edit]
Type relationships
(C++11)
checks if two types are the same
(class template) [edit]
checks if a type is derived from the other type
(class template) [edit]
checks if a type can be converted to the other type
(class template) [edit]

[편집] Type modifications

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.

<type_traits> 헤더에 정의되어 있음.
Const-volatility specifiers
removes const or/and volatile specifiers from the given type
(class template) [edit]
(C++11)
(C++11)
(C++11)
adds const or/and volatile specifiers to the given type
(class template) [edit]
References
removes reference from the given type
(class template) [edit]
adds lvalue or rvalue reference to the given type
(class template) [edit]
Pointers
removes pointer from the given type
(class template) [edit]
adds pointer to the given type
(class template) [edit]
Sign modifiers
makes the given integral type signed
(class template) [edit]
makes the given integral type unsigned
(class template) [edit]
Arrays
removes one extent from the given array type
(class template) [edit]
removes all extents from the given array type
(class template) [edit]

[편집] Miscellaneous transformations

<type_traits> 헤더에 정의되어 있음.
defines the type suitable for use as uninitialized storage for types of given size
(class template) [edit]
defines the type suitable for use as uninitialized storage for all given types
(class template) [edit]
(C++11)
applies type transformations as when passing a function argument by value
(class template) [edit]
(C++11)
hides a function overload or template specialization based on compile-time boolean
(class template) [edit]
chooses one type or another based on compile-type boolean
(class template) [edit]
deduces the result type of a mixed-mode arithmetic expression
(class template) [edit]
obtains the underlying integer type for a given enumeration type
(class template) [edit]
(C++11)
deduces the return type of a function call expression
(class template) [edit]

[편집] Helper classes

<type_traits> 헤더에 정의되어 있음.
compile-time constant of specified type with specified value
(class template) [edit]

Two specializations of std::integral_constant for the type bool are provided:

<type_traits> 헤더에 정의되어 있음.
Type Definition
true_type std::integral_constant<bool, true>
false_type std::integral_constant<bool, false>