<type_traits>
[added with C++11]
add_const
· add_cv
· add_pointer
· add_lvalue_reference
· add_reference
· add_rvalue_reference
· add_volatile
· aligned_storage
· aligned_union
· alignment_of
· common_type
· conditional
· decay
· enable_if
· extent
· false_type
· integral_constant
· make_signed
· make_unsigned
· rank
· remove_all_extents
· remove_const
· remove_cv
· remove_extent
· remove_pointer
· remove_reference
· remove_volatile
· result_of
· true_type
· underlying_type
has_copy_assign
· has_copy_constructor
· has_default_constructor
· has_move_assign
· has_move_constructor
· has_nothrow_assign
· has_nothrow_constructor
· has_nothrow_copy
· has_nothrow_copy_assign
· has_nothrow_copy_constructor
· has_nothrow_default_constructor
· has_nothrow_move_assign
· has_nothrow_move_constructor
· has_trivial_assign
· has_trivial_constructor
· has_trivial_copy
· has_trivial_copy_assign
· has_trivial_copy_constructor
· has_trivial_default_constructor
· has_trivial_destructor
· has_trivial_move_assign
· has_trivial_move_constructor
· has_virtual_destructor
is_abstract
· is_arithmetic
· is_array
· is_assignable
· is_base_of
· is_class
· is_compound
· is_const
· is_constructible
· is_convertible
· is_copy_assignable
· is_copy_constructible
· is_default_constructible
· is_destructible
· is_move_assignable
· is_move_constructible
· is_empty
· is_enum
· is_floating_point
· is_function
· is_fundamental
· is_integral
· is_literal_type
· is_lvalue_reference
· is_member_function_pointer
· is_member_object_pointer
· is_member_pointer
· is_nothrow_assignable
· is_nothrow_constructible
· is_nothrow_copy_assignable
· is_nothrow_copy_constructible
· is_nothrow_default_constructible
· is_nothrow_destructible
· is_nothrow_move_assignable
· is_nothrow_move_constructible
· is_object
· is_pod
· is_pointer
· is_polymorphic
· is_reference
· is_rvalue_reference
· is_same
· is_scalar
· is_signed
· is_standard_layout
· is_trivial
· is_trivially_assignable
· is_trivially_constructible
· is_trivially_copyable
· is_trivially_copy_assignable
· is_trivially_copy_constructible
· is_trivially_default_constructible
· is_trivially_destructible
· is_trivially_move_assignable
· is_trivially_move_constructible
· is_union
· is_unsigned
· is_void
· is_volatile
Include the TR1
header <type_traits>
to define several templates
that provide compile-time constants giving information about the properties
of their type arguments.
namespace std { // HELPER CLASSES template<class Ty, Ty v> struct integral_constant; typedef integral_constant<bool, false> false_type; typedef integral_constant<bool, true> true_type; // TYPE CATEGORIES template<class Ty> struct is_void; template<class Ty> struct is_integral; template<class Ty> struct is_floating_point; template<class Ty> struct is_array; template<class Ty> struct is_pointer; template<class Ty> struct is_member_object_pointer; template<class Ty> struct is_member_function_pointer; template<class Ty> struct is_enum; template<class Ty> struct is_union; template<class Ty> struct is_class; template<class Ty> struct is_function; template<class Ty> struct is_arithmetic; template<class Ty> struct is_fundamental; template<class Ty> struct is_object; template<class Ty> struct is_scalar; template<class Ty> struct is_compound; template<class Ty> struct is_member_pointer; template<class Ty> struct is_reference; template<class Ty> struct is_lvalue_reference; [added with C++11] template<class Ty> struct is_rvalue_reference; [added with C++11] // TYPE PROPERTIES template<class Ty> struct is_signed; template<class Ty> struct is_unsigned; template<class Ty> struct is_const; template<class Ty> struct is_volatile; template<class Ty> struct is_pod; template<class Ty> struct is_empty; template<class Ty> struct is_polymorphic; template<class Ty> struct is_abstract; template<class Ty> struct is_standard_layout; [added with C++11] template<class Ty> struct is_literal_type; [added with C++11] template<class Ty> struct is_trivial; [added with C++11] template<class Ty> struct is_trivially_copyable; [added with C++11] template<class Ty, class... Args> struct is_constructible; [added with C++11] template<class Ty> struct is_default_constructible; [added with C++11] template<class Ty> struct is_copy_constructible; [added with C++11] template<class Ty> struct is_move_constructible; [added with C++11] template<class T0, class From> struct is_assignable; [added with C++11] template<class Ty> struct is_copy_assignable; [added with C++11] template<class Ty> struct is_move_assignable; [added with C++11] template<class Ty> struct is_destructible; [added with C++11] template<class Ty, class... Args> struct is_nothrow_constructible; [added with C++11] template<class Ty> struct is_nothrow_default_constructible; [added with C++11] template<class Ty> struct is_nothrow_copy_constructible; [added with C++11] template<class Ty> struct is_nothrow_move_constructible; [added with C++11] template<class T0, class From> struct is_nothrow_assignable; [added with C++11] template<class Ty> struct is_nothrow_copy_assignable; [added with C++11] template<class Ty> struct is_nothrow_move_assignable; [added with C++11] template<class Ty> struct is_nothrow_destructible; [added with C++11] template<class Ty, class... Args> struct is_trivially_constructible; [added with C++11] template<class Ty> struct is_trivially_default_constructible; [added with C++11] template<class Ty> struct is_trivially_copy_constructible; [added with C++11] template<class Ty> struct is_trivially_move_constructible; [added with C++11] template<class T0, class From> struct is_trivially_assignable; [added with C++11] template<class Ty> struct is_trivially_copy_assignable; [added with C++11] template<class Ty> struct is_trivially_move_assignable; [added with C++11] template<class Ty> struct is_trivially_destructible; [added with C++11] template<class Ty> struct has_default_constructor; [temporarily added with C++11] template<class Ty> struct has_copy_constructor; [temporarily added with C++11] template<class Ty> struct has_copy_assign; [temporarily added with C++11] template<class Ty> struct has_move_assign; [temporarily added with C++11] template<class Ty> struct has_nothrow_constructor; [removed with C++11] template<class Ty> struct has_nothrow_default_constructor; [temporarily added with C++11] template<class Ty> struct has_nothrow_copy; [removed with C++11] template<class Ty> struct has_nothrow_copy_constructor; [temporarily added with C++11] template<class Ty> struct has_nothrow_move_constructor; [temporarily added with C++11] template<class Ty> struct has_nothrow_assign; [removed with C++11] template<class Ty> struct has_nothrow_copy_assign; [temporarily added with C++11] template<class Ty> struct has_nothrow_move_assign; [temporarily added with C++11] template<class Ty> struct has_trivial_constructor; [removed with C++11] template<class Ty> struct has_trivial_default_constructor; [temporarily added with C++11] template<class Ty> struct has_trivial_copy; [removed with C++11] template<class Ty> struct has_trivial_copy_constructor; [temporarily added with C++11] template<class Ty> struct has_trivial_move_constructor; [temporarily added with C++11] template<class Ty> struct has_trivial_assign; [removed with C++11] template<class Ty> struct has_trivial_copy_assign; [temporarily added with C++11] template<class Ty> struct has_trivial_move_assign; [temporarily added with C++11] template<class Ty> struct has_trivial_destructor; [removed with C++11] template<class Ty> struct has_virtual_destructor; template<class Ty> struct alignment_of; template<class Ty> struct rank; template<class Ty, unsigned I = 0> struct extent; // TYPE COMPARISONS template<class Ty1, class Ty2> struct is_same; template<class From, class To> struct is_convertible; template<class Base, class Derived> struct is_base_of; // CONST-VOLATILE MODIFICATIONS template<class Ty> struct remove_const; template<class Ty> struct remove_volatile; template<class Ty> struct remove_cv; template<class Ty> struct add_const; template<class Ty> struct add_volatile; template<class Ty> struct add_cv; // REFERENCE MODIFICATIONS template<class Ty> struct remove_reference; template<class Ty> struct add_reference; [removed with C++11] template<class Ty> struct add_lvalue_reference; [added with C++11] template<class Ty> struct add_rvalue_reference; [added with C++11] // ARRAY MODIFICATIONS template<class Ty> struct remove_extent; template<class Ty> struct remove_all_extents; // POINTER MODIFICATIONS template<class Ty> struct remove_pointer; template<class Ty> struct add_pointer; // TYPE DETERMINATIONS template<class Ty> struct result_of; template<class Ty> struct decay; [added with C++11] template<class Ty> struct make_signed; [added with C++11] template<class Ty> struct make_unsigned; [added with C++11] template<class Ty> struct aligned_storage; template<size_t Len, class... Types> struct aligned_union; [added with C++11] template<class... Types> struct common_type; [added with C++11] template<class Ty> struct underlying_type; [added with C++11] // TYPE TESTS template<bool, class Ty> struct enable_if; [added with C++11] template<bool, class Ty1, class Ty2> struct conditional; [added with C++11] namespace tr1 { using std::add_const; using std::add_cv; [added with C++11] using std::add_pointer; using std::add_reference; using std::add_volatile; using std::aligned_storage; using std::alignment_of; using std::extent; using std::false_type; using std::has_move_constructor; using std::has_nothrow_assign; using std::has_nothrow_constructor; using std::has_nothrow_copy; using std::has_nothrow_default_constructor; using std::has_trivial_assign; using std::has_trivial_constructor; using std::has_trivial_copy; using std::has_trivial_destructor; using std::has_virtual_destructor; using std::integral_constant; using std::is_abstract; using std::is_arithmetic; using std::is_array; using std::is_base_of; using std::is_class; using std::is_compound; using std::is_const; using std::is_convertible; using std::is_empty; using std::is_enum; using std::is_floating_point; using std::is_function; using std::is_fundamental; using std::is_integral; using std::is_member_function_pointer; using std::is_member_object_pointer; using std::is_member_pointer; using std::is_object; using std::is_pod; using std::is_pointer; using std::is_polymorphic; using std::is_reference; using std::is_same; using std::is_scalar; using std::is_signed; using std::is_union; using std::is_unsigned; using std::is_void; using std::is_volatile; using std::rank; using std::remove_all_extents; using std::remove_const; using std::remove_cv; using std::remove_extent; using std::remove_pointer; using std::remove_reference; using std::remove_volatile; using std::result_of; using std::true_type; } // namespace tr1 } // namespace std
A type predicate is a template taking
one or more type arguments. When a type predicate
holds true it is publicly derived, directly or
indirectly, from true_type. When a type predicate
holds false it is publicly derived, directly or
indirectly, from false_type
.
A type modifier is a template taking one or more template arguments and having the following member:
typedef modified-type type;
A type query is a template taking one or more
template arguments. A type query is publicly derived, directly or indirectly,
from integral_constant<size_t, value>
; it
holds the value passed as the argument
value
.
add_const
template<class Ty> struct add_const;
An instance of the type modifier
holds a modified-type that is Ty
if Ty
is a reference, a function, or a const-qualified type,
otherwise const Ty
.
add_cv
template<class Ty> struct add_cv;
An instance of the type modifier
holds the modified-type
add_volatile<
add_const<Ty> >
.
add_pointer
template<class Ty> struct add_pointer;
An instance of the type modifier
holds the modified-type
Ty1*
if Ty
is of the form Ty1[N]
or Ty1&
, otherwise Ty*
.
add_lvalue_reference
template<class Ty> struct add_lvalue_reference; [added with C++11]
An instance of the type modifier
holds a modified-type that is Ty
if Ty
is an lvalue reference,
otherwise typename remove_reference<Ty>::type&
.
add_reference
template<class Ty> struct add_reference; [removed with C++11]
An instance of the type modifier
holds a modified-type that is Ty
if Ty
is an lvalue reference,
otherwise typename remove_reference<Ty>::type&
.
add_rvalue_reference
template<class Ty> struct add_rvalue_reference; [added with C++11]
An instance of the type modifier
holds a modified-type that is Ty
if Ty
is an lvalue reference,
otherwise typename remove_reference<Ty>::type&&
.
add_volatile
template<class Ty> struct add_volatile;
An instance of the type modifier
holds a modified-type that is Ty
if Ty
is a reference, a function, or a volatile-qualified type,
otherwise volatile Ty
.
aligned_storage
template<size_t Len, size_t Align> struct aligned_storage { typedef aligned-type type; };
The nested typedef type
is a synonym for a POD type with
alignment Align
and size Len
. Align
must be equal to alignment_of<Ty1>::value
for some type
Ty1
.
aligned_union
template<size_t Len, class... Types> struct aligned_union; [added with C++11]
The nested typedef type
is a synonym for a union
that effectively contains the members:
union { aligned_storage<Len, Types...>; };
If Types
is empty, it is taken as char
.
alignment_of
template<class Ty> struct alignment_of;
The type query
holds the value of the the alignment of the
type Ty
.
common_type
template<class... Types> struct common_type; [added with C++11]
An instance of the type modifier holds a modified-type that is:
Types
, if the template parameter pack has exactly one argumentdecltype(true ? Tgen() : Ugen())
,
where Tgen()
is an imaginary function returning a value of type
T&&
and Ugen()
is an imaginary function
returning a value of type U&&
, if the template parameter
pack has exactly two arguments T
and U
common_type<typename
common_type<T, U>::type, V...>::type
, if the parameter pack
has more than two arguments; the types T
and U
are the first two type arguments, respectively, and V...
is a parameter pack holding the remainder of the arguments
in the parameter pack.conditional
template<bool pred, class Ty1, class Ty2> struct conditional; [added with C++11]
An instance of the type modifier holds a modified-type that is either:
Ty1
, if pred
is trueTy2
, if pred
is falsedecay
template<class Ty> struct decay; [added with C++11]
An instance of the type modifier holds a modified-type that is defined in the following stages:
U
is defined as
remove_reference<Ty>::type
.is_array<U>
holds true,
the modified-type type
is
remove_extent<U>::type *
.is_function<U>
holds true,
the modified-type type
is
add_pointer<U>::type
.type
is
remove_cv<U>::type
.enable_if
template<bool pred, class Ty> struct enable_if; [added with C++11]
An instance of the type modifier holds a modified-type that is either:
Ty
, if pred
is truepred
is falseextent
template<class Ty, unsigned I = 0> struct extent;
The type query
holds the value of the number of elements in
the Ith
bound of objects of type Ty
.
If Ty
is not an array type or its rank is less than I
,
or if I
is zero and Ty
is of type "array of unknown
bound of U
", it holds the value 0.
false_type
typedef integral_constant<bool, false> false_type;
The type is a synonym for a specialization of the template
integral_constant
.
has_copy_assign
template<class Ty> struct has_copy_assign; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
has
a copy assignment operator,
otherwise it holds false.
has_copy_constructor
template<class Ty> struct has_copy_constructor; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
has
a copy constructor,
otherwise it holds false.
has_default_constructor
template<class Ty> struct has_default_constructor; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
has
a default constructor,
otherwise it holds false.
has_move_assign
template<class Ty> struct has_move_assign; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
has
a move assignment operator,
otherwise it holds false.
has_move_constructor
template<class Ty> struct has_move_constructor; [added with C++11]
An instance of the type predicate
holds true if the type Ty
has
a move constructor,
otherwise it holds false.
has_nothrow_assign
template<class Ty> struct has_nothrow_assign;
An instance of the type predicate
holds true if the type Ty
has
a nothrow copy assignment operator,
otherwise it holds false.
A nothrow function is a function that has an empty throw specifier, or a function which the compiler can otherwise determine will not throw an exception.
has_nothrow_constructor
template<class Ty> struct has_nothrow_constructor; [removed with C++11]
An instance of the type predicate
holds true if the type Ty
has
a nothrow default constructor,
otherwise it holds false.
has_nothrow_copy
template<class Ty> struct has_nothrow_copy; [removed with C++11]
An instance of the type predicate
holds true if the type Ty
has
a nothrow copy constructor,
otherwise it holds false.
has_nothrow_copy_assign
template<class Ty> struct has_nothrow_copy_assign; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
has
a nothrow copy assignment operator,
otherwise it holds false.
has_nothrow_copy_constructor
template<class Ty> struct has_nothrow_copy_constructor; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
has
only nothrow copy constructors,
otherwise it holds false.
has_nothrow_default_constructor
template<class Ty> struct has_nothrow_default_constructor; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
has
a nothrow default constructor,
otherwise it holds false.
has_nothrow_move_assign
template<class Ty> struct has_nothrow_move_assign; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
has
a nothrow move assignment operator,
otherwise it holds false.
has_nothrow_move_constructor
template<class Ty> struct has_nothrow_move_constructor; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
has
a nothrow move constructor,
otherwise it holds false.
has_trivial_assign
template<class Ty> struct has_trivial_assign; [removed with C++11]
An instance of the type predicate
holds true if the type Ty
is
a class that has a trivial copy assignment operator,
otherwise it holds false.
A copy assignment operator for a class Ty
is trivial if:
Ty
has no virtual functionsTy
has no virtual basesTy
have trivial copy assignment operatorshas_trivial_constructor
template<class Ty> struct has_trivial_constructor; [removed with C++11]
An instance of the type predicate
holds true if the type Ty
is
a class that has a trivial constructor,
otherwise it holds false.
A constructor for a class Ty
is trivial if:
Ty
has no virtual functionsTy
has no virtual basesTy
have trivial constructorshas_trivial_copy
template<class Ty> struct has_trivial_copy; [removed with C++11]
An instance of the type predicate
holds true if the type Ty
is
a class that has a trivial copy constructor,
otherwise it holds false.
A copy constructor for a class Ty
is trivial if:
Ty
has no virtual functionsTy
has no virtual basesTy
have trivial copy constructorshas_trivial_copy_assign
template<class Ty> struct has_trivial_copy_assign; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
is
a class that has all trivial copy assignment operators,
otherwise it holds false.
has_trivial_copy_constructor
template<class Ty> struct has_trivial_copy_constructor; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
is
a class that has only trivial copy constructors,
otherwise it holds false.
A copy constructor for a class Ty
is trivial if:
Ty
has no virtual functionsTy
has no virtual basesTy
have trivial copy constructorshas_trivial_default_constructor
template<class Ty> struct has_trivial_default_constructor; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
is
a class that has a trivial constructor,
otherwise it holds false.
A default constructor for a class Ty
is trivial if:
Ty
has no virtual functionsTy
has no virtual basesTy
have trivial constructorshas_trivial_destructor
template<class Ty> struct has_trivial_destructor; [removed with C++11]
An instance of the type predicate
holds true if the type Ty
is
a class that has a trivial destructor,
otherwise it holds false.
A destructor for a class Ty
is trivial if:
Ty
have trivial destructorshas_trivial_move_assign
template<class Ty> struct has_trivial_move_assign; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
is
a class that has all trivial move assignment operators,
otherwise it holds false.
has_trivial_move_constructor
template<class Ty> struct has_trivial_move_constructor; [temporarily added with C++11]
An instance of the type predicate
holds true if the type Ty
is
a class that has a trivial move constructor,
otherwise it holds false.
has_virtual_destructor
template<class Ty> struct has_virtual_destructor;
An instance of the type predicate
holds true if the type Ty
is
a class that has a virtual destructor,
otherwise it holds false.
integral_constant
template<class Ty, Ty v> struct integral_constant { static const Ty value = v; typedef Ty value_type; typedef integral_constant<Ty, v> type; constexpr operator value_type() const; };
The template class, when specialized with an integral type and a value of
that type, represents an object that holds a constant of that integral
type with the specified value. operator value_type()
returns value
.
is_abstract
template<class Ty> struct is_abstract;
An instance of the type predicate
holds true if the type Ty
is
a class that has at least one pure virtual function,
otherwise it holds false.
is_arithmetic
template<class Ty> struct is_arithmetic;
An instance of the type predicate
holds true if the type Ty
is
an arithmetic type, that is, an integral type
or a floating point type,
or a cv-qualified
form of one of them,
otherwise it holds false.
is_array
template<class Ty> struct is_array;
An instance of the type predicate
holds true if the type Ty
is
an array type,
otherwise it holds false.
is_assignable
template<class To, class From> struct is_assignable; [added with C++11]
An instance of the type predicate holds true only if the unevaluated operand:
declval<To>() = declval>From>()
is well formed.
is_base_of
template<class Base, class Derived> struct is_base_of;
An instance of the type predicate
holds true if the type Base
is
a base class of the type Derived
,
otherwise it holds false.
is_class
template<class Ty> struct is_class;
An instance of the type predicate
holds true if the type Ty
is
a type defined as a class
or a struct
,
or a cv-qualified
form of one of them,
otherwise it holds false.
is_compound
template<class Ty> struct is_compound;
An instance of the type predicate
holds false if the type Ty
is
a scalar type (that is, if is_scalar<Ty>
holds true),
otherwise it holdstrue.
Thus, the predicate holds true
if Ty
is an array type, a function type, a pointer to void
or
an object or a function, a reference, a class, a union, an enumeration, or
a pointer to non-static class member,
or a cv-qualified
form of one of them.
is_const
template<class Ty> struct is_const;
An instance of the type predicate
holds true if Ty
is
const-qualified
.
is_constructible
template<class Ty, class... Args> struct is_constructible; [added with C++11]
An instance of the type predicate holds true only if the variable definition:
Ty X(declval<Args>()...);
is well formed.
is_convertible
template<class From, class To> struct is_convertible;
An instance of the type predicate
holds true if the expression To to = from;
,
where from
is an object of type From
, is well-formed.
is_copy_assignable
template<class Ty> struct is_copy_assignable; [added with C++11]
An instance of the type predicate
is equivalent to is_assignable<Ty, const Ty&>
.
is_copy_constructible
template<class Ty> struct is_copy_constructible; [added with C++11]
An instance of the type predicate
is equivalent to is_constructible<Ty, const Ty&>
.
is_default_constructible
template<class Ty> struct is_default_constructible; [added with C++11]
An instance of the type predicate
is equivalent to is_constructible<Ty>
.
is_destructible
template<class Ty> struct is_destructible; [added with C++11]
An instance of the type predicate holds true only if, in the template definition:
template<class Ty> struct S { Ty X; };
the destructor S<Ty>::~S()
is not deleted.
is_empty
template<class Ty> struct is_empty;
An instance of the type predicate
holds true if the type Ty
is an
empty class, otherwise it holds false.
is_enum
template<class Ty> struct is_enum;
An instance of the type predicate
holds true if the type Ty
is
an enumeration type or a cv-qualified
form of an enumeration type,
otherwise it holds false.
is_floating_point
template<class Ty> struct is_floating_point;
An instance of the type predicate
holds true if the type Ty
is
a floating point type or a cv-qualified
form of a floating point type,
otherwise it holds false.
A floating point type is one of
float
, double
, or long double
.
is_function
template<class Ty> struct is_function;
An instance of the type predicate
holds true if the type Ty
is
a function type,
otherwise it holds false.
is_fundamental
template<class Ty> struct is_fundamental;
An instance of the type predicate
holds true if the type Ty
is a
fundamental type, that is, void
,
an integral type,
an floating point type,
or a cv-qualified
form of one of them,
otherwise it holds false.
is_integral
template<class Ty> struct is_integral;
An instance of the type predicate
holds true if the type Ty
is
one of the integral types, or a cv-qualified
form of one
of the integral types, otherwise it holds false.
An integral type is one of
bool
,
char
,
unsigned char
,
signed char
,
wchar_t
,
short
,
unsigned short
,
int
,
unsigned int
,
long
,
and unsigned long
.
In addition, with compilers that provide them, an integral type
can be one of
long long
,
unsigned long long
,
__int64
,
and unsigned __int64
.
is_literal_type
template<class Ty> struct is_literal_type; [added with C++11]
An instance of the type predicate
holds true if the type Ty
is
a literal type,
otherwise it holds false.
is_lvalue_reference
template<class Ty> struct is_lvalue_reference; [added with C++11]
An instance of the type predicate
holds true if the type Ty
is
a reference to an object or to a function,
otherwise it holds false.
Note that it may not be an
rvalue reference.
is_member_function_pointer
template<class Ty> struct is_member_function_pointer;
An instance of the type predicate
holds true if the type Ty
is
a pointer to member function or a cv-qualified
pointer to
member function,
otherwise it holds false.
is_member_object_pointer
template<class Ty> struct is_member_object_pointer;
An instance of the type predicate
holds true if the type Ty
is
a pointer to member object or a cv-qualified
pointer to member object,
otherwise it holds false. Note that is_member_object_pointer
holds false if Ty
is a pointer to member function.
is_member_pointer
template<class Ty> struct is_member_pointer;
An instance of the type predicate
holds true if the type Ty
is
a pointer to member function or a pointer to member object,
or a cv-qualified
form of one of them,
otherwise it holds false.
is_move_assignable
template<class Ty> struct is_move_assignable; [added with C++11]
An instance of the type predicate
is equivalent to is_assignable<Ty, Ty&&>
.
is_move_constructible
template<class Ty> struct is_move_constructible; [added with C++11]
An instance of the type predicate
is equivalent to is_constructible<Ty, Ty&&>
.
is_nothrow_assignable
template<class To, class From> struct is_nothrow_assignable; [added with C++11]
An instance of the type predicate holds true only if the unevaluated operand:
declval<To>() = declval>From>()
is well formed and is known to throw no exceptions.
is_nothrow_constructible
template<class Ty, class... Args> struct is_nothrow_constructible; [added with C++11]
An instance of the type predicate holds true only if the variable definition:
Ty X(declval<Args>()...);
is well formed and is known to throw no exceptions.
is_nothrow_copy_assignable
template<class Ty> struct is_nothrow_copy_assignable; [added with C++11]
An instance of the type predicate
is equivalent to is_nothrow_assignable<Ty, const Ty&>
.
is_nothrow_copy_constructible
template<class Ty> struct is_nothrow_copy_constructible; [added with C++11]
An instance of the type predicate
is equivalent to is_nothrow_constructible<Ty, const Ty&>
.
is_nothrow_default_constructible
template<class Ty> struct is_nothrow_default_constructible; [added with C++11]
An instance of the type predicate
is equivalent to is_nothrow_constructible<Ty>
.
is_nothrow_destructible
template<class Ty> struct is_nothrow_destructible; [added with C++11]
An instance of the type predicate holds true only if, in the template definition:
template<class Ty> struct S { Ty X; };
the destructor S<Ty>::~S()
is not deleted
and is known to throw no exceptions.
is_nothrow_move_assignable
template<class Ty> struct is_nothrow_move_assignable; [added with C++11]
An instance of the type predicate
is equivalent to is_nothrow_assignable<Ty, Ty&&>
.
is_nothrow_move_constructible
template<class Ty> struct is_nothrow_move_constructible; [added with C++11]
An instance of the type predicate
is equivalent to is_nothrow_constructible<Ty, Ty&&>
.
is_object
template<class Ty> struct is_object;
An instance of the type predicate
holds false if the type Ty
is
a reference type, a function type, or void,
or a cv-qualified
form of one of them,
otherwise it holds true.
is_pod
template<class Ty> struct is_pod;
An instance of the type predicate
holds true if the type Ty
is
a scalar type, a POD aggregate type,
or a cv-qualified
form of one of them,
or an array of such a type,
otherwise it holds false.
A POD aggregate type is a class, struct, or union whose non-static data members are all scalar types or POD aggregates, and that has no references, no user-defined copy assignment operator, and no user-defined destructor.
is_pointer
template<class Ty> struct is_pointer;
An instance of the type predicate
holds true if the type Ty
is
a pointer to void
, a pointer to an object, or a pointer to a function,
or a cv-qualified
form of one of them,
otherwise it holds false. Note that is_pointer
holds false if Ty
is a pointer to member or a pointer to
member function.
is_polymorphic
template<class Ty> struct is_polymorphic;
An instance of the type predicate
holds true if the type Ty
is a class that declares or inherits a virtual function,
otherwise it holds false.
is_reference
template<class Ty> struct is_reference;
An instance of the type predicate
holds true if the type Ty
is
a reference to an object or to a function,
otherwise it holds false.
Beginning with C++11, it may also be an
rvalue reference.
is_rvalue_reference
template<class Ty> struct is_rvalue_reference; [added with C++11]
An instance of the type predicate
holds true if the type Ty
is an
rvalue reference.
is_same
template<class Ty1, class Ty2> struct is_same;
An instance of the type predicate
holds true if the types Ty1
and Ty2
are the same type,
otherwise it holds false.
is_scalar
template<class Ty> struct is_scalar;
An instance of the type predicate
holds true if the type Ty
is
an integral type,
a floating point type,
an enumeration type, a pointer type, or a pointer to member type,
or a cv-qualified
form of one of them,
otherwise it holds false.
is_signed
template<class Ty> struct is_signed;
An instance of the type predicate
holds true if the type Ty
is
a signed integral type
or a cv-qualified
signed integral type,
otherwise it holds false.
Beginning with C++11 it may also be
a floating point type,
an enumeration, or a cv-qualified
form of one of these types.
A type is considered signed if Ty(-1) < Ty(0)
.
is_standard_layout
template<class Ty> struct is_standard_layout; [added with C++11]
An instance of the type predicate
holds true if the type Ty
is a class that has a standard layout of member objects in memory,
otherwise it holds false.
is_trivial
template<class Ty> struct is_trivial; [added with C++11]
An instance of the type predicate
holds true if the type Ty
is a trivial class,
otherwise it holds false.
is_trivially_assignable
template<class To, class From> struct is_trivially_assignable; [added with C++11]
An instance of the type predicate holds true only if the unevaluated operand:
declval<To>() = declval>From>()
is well formed and is known to perform no operation that is not trivial.
is_trivially_constructible
template<class Ty, class... Args> struct is_trivially_constructible; [added with C++11]
An instance of the type predicate holds true only if the variable definition:
Ty X(declval<Args>()...);
is well formed and is known to perform no operation that is not trivial.
is_trivially_copy_assignable
template<class Ty> struct is_trivially_copy_assignable; [added with C++11]
An instance of the type predicate
is equivalent to is_trivially_assignable<Ty, const Ty&>
.
is_trivially_copy_constructible
template<class Ty> struct is_trivially_copy_constructible; [added with C++11]
An instance of the type predicate
is equivalent to is_trivially_constructible<Ty, const Ty&>
.
is_trivially_copyable
template<class Ty> struct is_trivially_copyable; [added with C++11]
An instance of the type predicate
is equivalent to is_trivially_copy_constructible<Ty>
.
is_trivially_default_constructible
template<class Ty> struct is_trivially_default_constructible; [added with C++11]
An instance of the type predicate
is equivalent to is_trivially_constructible<Ty>
.
is_trivially_destructible
template<class Ty> struct is_trivially_destructible; [added with C++11]
An instance of the type predicate holds true only if, in the template definition:
template<class Ty> struct S { Ty X; };
the destructor S<Ty>::~S()
is not deleted
and is known to perform no operation that is not trivial.
is_trivially_move_assignable
template<class Ty> struct is_trivially_move_assignable; [added with C++11]
An instance of the type predicate
is equivalent to is_trivially_assignable<Ty, Ty&&>
.
is_trivially_move_constructible
template<class Ty> struct is_trivially_move_constructible; [added with C++11]
An instance of the type predicate
is equivalent to is_trivially_constructible<Ty, Ty&&>
.
is_union
template<class Ty> struct is_union;
An instance of the type predicate
holds true if the type Ty
is
a union type or a cv-qualified
form of a union type,
otherwise it holds false.
is_unsigned
template<class Ty> struct is_unsigned;
An instance of the type predicate
holds true if the type Ty
is
an unsigned integral type
or a cv-qualified
unsigned integral type,
otherwise it holds false.
Beginning with C++11 it may also be
an enumeration, or a cv-qualified
form of such a type.
A type is considered unsigned if Ty(0) < Ty(-1)
.
is_void
template<class Ty> struct is_void;
An instance of the type predicate
holds true if the type Ty
is
void
or a cv-qualified
form of void
,
otherwise it holds false.
is_volatile
template<class Ty> struct is_volatile;
An instance of the type predicate
holds true if Ty
is
volatile-qualified
.
make_signed
template<class Ty> struct make_signed; [added with C++11]
An instance of the type modifier
holds a modified-type that is Ty
if
is_signed<Ty>
holds true. Otherwise it is the smallest signed type
STy
for which sizeof (Ty) <= sizeof (STy)
.
make_unsigned
template<class Ty> struct make_unsigned; [added with C++11]
An instance of the type modifier
holds a modified-type that is Ty
if
is_unsigned<Ty>
holds true. Otherwise it is the smallest unsigned type
UTy
for which sizeof (Ty) <= sizeof (UTy)
.
rank
template<class Ty> struct rank;
The type query
holds the value of the number of dimensions of
the array type Ty
, or 0 if Ty
is not an array type.
remove_all_extents
template<class Ty> struct remove_all_extents;
An instance of the type modifier
holds a modified-type that is
the element type of the array type Ty
with all array dimensions
removed, or Ty
if Ty
is not an array type.
remove_extent
template<class Ty> struct remove_extent;
An instance of the type modifier
holds a modified-type that is
Ty1
when Ty
is of the form Ty1[N]
,
otherwise Ty
.
remove_const
template<class Ty> struct remove_const;
An instance of the type modifier
holds a modified-type that is
Ty1
when Ty
is of the form const Ty1
,
otherwise Ty
.
remove_cv
template<class Ty> struct remove_cv;
An instance of the type modifier
holds a modified-type that is
Ty1
when Ty
is of the form const Ty1
,
volatile Ty1
, or const volatile Ty1
,
otherwise Ty
.
remove_pointer
template<class Ty> struct remove_pointer;
An instance of the type modifier
holds a modified-type that is
Ty1
when Ty
is of the form Ty1*
,
Ty1* const
, Ty1* volatile
, or Ty1* const volatile
,
otherwise Ty
.
remove_reference
template<class Ty> struct remove_reference;
An instance of the type modifier
holds a modified-type that is
Ty1
when Ty
is of the form Ty1&
,
otherwise Ty
.
remove_volatile
template<class Ty> struct remove_volatile;
An instance of the type modifier
holds a modified-type that is
Ty1
when Ty
is of the form volatile Ty1
,
otherwise Ty
.
result_of
template<class Ty> [added with C++11] struct result_of { typedef T0 type; };
The template class defines its member type
as a synonym for
the return type of a function call described by its template argument
Ty
. The template argument must be of the form
Fty(T1, T2, ..., TN)
, where Fty
is a
callable type. The template determines
the return type according to the first of the following rules that applies:
Fty
is a pointer to function type R(*)(U1, U2, ..., UN) the
return type is R;Fty
is a pointer to member function type
R(U1::*)(U2, ..., UN) the return type is R;Fty
is a pointer to data member type
R U1::* the return type is R;Fty
is a class with a member typedef result_type the
return type is Fty::result_type;Ty
is of the form Fty()
)
the return type is void;Fty
is a class with a member template named result
the return type is Fty::result<T1, T2, ..., TN>::type;true_type
typedef integral_constant<bool, true> true_type;
The type is a synonym for a specialization of the template
integral_constant
.
underlying_type
template<class Ty> struct underlying_type; [added with C++11]
An instance of the type modifier
holds a modified-type that is the
underlying type for the enumeration type Ty
.
See also the Table of Contents and the Index.
Copyright © 1992-2013 by Dinkumware, Ltd. All rights reserved.