Spec-Zone.ru › C++

Стандартная библиотека заголовок <type_traits> (C++11)

Этот заголовок является частью библиотеки метапрограммирования.

Классы

Вспомогательные классы
integral_constantbool_constant
(C++11)(C++17)
константа времени компиляции заданного типа со значением
(шаблон класса)
true_type std::integral_constant<bool, true>
false_type std::integral_constant<bool, false>
Основные категории типов
is_void
(C++11)
проверяет, является ли тип void
(шаблон класса)
is_null_pointer
(C++14)
проверяет, является ли тип указателем на std::nullptr_t
(шаблон класса)
is_integral
(C++11)
проверяет, является ли тип целочисленным типом
(шаблон класса)
is_floating_point
(C++11)
проверяет, является ли тип типом с плавающей точкой
(шаблон класса)
is_array
(C++11)
проверяет, является ли тип массивом
(шаблон класса)
is_enum
(C++11)
проверяет, является ли тип типом перечисления
(шаблон класса)
is_union
(C++11)
проверяет, является ли тип объединением
(шаблон класса)
is_class
(C++11)
проверяет, является ли тип классом, не являющимся объединением
(шаблон класса)
is_function
(C++11)
проверяет, является ли тип типом функции
(шаблон класса)
is_pointer
(C++11)
проверяет, является ли тип указателем
(шаблон класса)
is_lvalue_reference
(C++11)
проверяет, является ли тип ссылкой на lvalue
(шаблон класса)
is_rvalue_reference
(C++11)
проверяет, является ли тип ссылкой на rvalue
(шаблон класса)
is_member_object_pointer
(C++11)
проверяет, является ли тип указателем на нестатическое член-объект
(шаблон класса)
is_member_function_pointer
(C++11)
проверяет, является ли тип указателем на нестатическую член-функцию
(шаблон класса)
Составные категории типов
is_fundamental
(C++11)
проверяет, является ли тип фундаментальным типом
(шаблон класса)
is_arithmetic
(C++11)
проверяет, является ли тип арифметическим типом
(шаблон класса)
is_scalar
(C++11)
проверяет, является ли тип скалярным типом
(шаблон класса)
is_object
(C++11)
проверяет, является ли тип объектом
(шаблон класса)
is_compound
(C++11)
проверяет, является ли тип составным типом
(шаблон класса)
is_reference
(C++11)
проверяет, является ли тип ссылкой (lvalue или rvalue)
(шаблон класса)
is_member_pointer
(C++11)
проверяет, является ли тип указателем на нестатическое член-функцию или объект
(шаблон класса)
Свойства типов
is_const
(C++11)
проверяет, является ли тип квалифицированным как const
(шаблон класса)
is_volatile
(C++11)
проверяет, является ли тип квалифицированным как volatile
(шаблон класса)
is_trivial
(C++11)
проверяет, является ли тип тривиальным
(шаблон класса)
is_trivially_copyable
(C++11)
проверяет, является ли тип тривиально копируемым
(шаблон класса)
is_standard_layout
(C++11)
проверяет, является ли тип типом со стандартной компоновкой
(шаблон класса)
END_OF_DOCUMENT_MARKER
is_pod
(C++11)(deprecated in C++20)
проверяет, является ли тип простым типом данных (POD)
(шаблон класса)
is_literal_type
(C++11)(deprecated in C++17)(removed in C++20)
проверяет, является ли тип литеральным типом
(шаблон класса)
has_unique_object_representations
(C++17)
проверяет, вносит ли каждый бит в представлении объекта типа вклад в его значение
(шаблон класса)
is_empty
(C++11)
проверяет, является ли тип классом (но не объединением) и не имеет ли нестатических данных-членов
(шаблон класса)
is_polymorphic
(C++11)
проверяет, является ли тип полиморфным типом класса
(шаблон класса)
is_abstract
(C++11)
проверяет, является ли тип абстрактным типом класса
(шаблон класса)
is_final
(C++14)
проверяет, является ли тип финальным типом класса
(шаблон класса)
is_aggregate
(C++17)
проверяет, является ли тип агрегатным типом
(шаблон класса)
is_implicit_lifetime
(C++23)
проверяет, является ли тип типом с неявным временем жизни
(шаблон класса)
is_signed
(C++11)
проверяет, является ли тип знаковым арифметическим типом
(шаблон класса)
is_unsigned
(C++11)
проверяет, является ли тип беззнаковым арифметическим типом
(шаблон класса)
is_bounded_array
(C++20)
проверяет, является ли тип массивом с известной границей
(шаблон класса)
is_unbounded_array
(C++20)
проверяет, является ли тип массивом с неизвестной границей
(шаблон класса)
is_scoped_enum
(C++23)
проверяет, является ли тип перечислением со скоупом
(шаблон класса)
Операции, поддерживаемые типами
is_constructibleis_trivially_constructibleis_nothrow_constructible
(C++11)(C++11)(C++11)
проверяет, есть ли у типа конструктор для указанных аргументов
(шаблон класса)
is_default_constructibleis_trivially_default_constructibleis_nothrow_default_constructible
(C++11)(C++11)(C++11)
проверяет, есть ли у типа конструктор по умолчанию
(шаблон класса)
is_copy_constructibleis_trivially_copy_constructibleis_nothrow_copy_constructible
(C++11)(C++11)(C++11)
проверяет, есть ли у типа копирующий конструктор
(шаблон класса)
is_move_constructibleis_trivially_move_constructibleis_nothrow_move_constructible
(C++11)(C++11)(C++11)
проверяет, может ли тип быть создан из ссылки на rvalue
(шаблон класса)
is_assignableis_trivially_assignableis_nothrow_assignable
(C++11)(C++11)(C++11)
проверяет, есть ли у типа оператор присваивания для указанного аргумента
(шаблон класса)
is_copy_assignableis_trivially_copy_assignableis_nothrow_copy_assignable
(C++11)(C++11)(C++11)
проверяет, есть ли у типа оператор копирующего присваивания
(шаблон класса)
is_move_assignableis_trivially_move_assignableis_nothrow_move_assignable
(C++11)(C++11)(C++11)
проверяет, есть ли у типа оператор перемещающего присваивания
(шаблон класса)
is_destructibleis_trivially_destructibleis_nothrow_destructible
(C++11)(C++11)(C++11)
проверяет, есть ли у типа не удалённый деструктор
(шаблон класса)
has_virtual_destructor
(C++11)
проверяет, есть ли у типа виртуальный деструктор
(шаблон класса)
is_swappable_withis_swappableis_nothrow_swappable_withis_nothrow_swappable
(C++17)(C++17)(C++17)(C++17)
проверяет, можно ли обменять объекты данного типа с объектами того же или другого типа
(шаблон класса)
Запросы свойств типов
alignment_of
(C++11)
получает требования к выравниванию типа
(шаблон класса)
rank
(C++11)
получает количество измерений типа массива
(шаблон класса)
extent
(C++11)
получает размер типа массива по указанному измерению
(шаблон класса)
Отношения типов
is_same
(C++11)
проверяет, совпадают ли два типа
(шаблон класса)
is_base_of
(C++11)
проверяет, является ли один тип производным от другого типа
(шаблон класса)
is_convertibleis_nothrow_convertible
(C++11)(C++20)
проверяет, можно ли преобразовать один тип в другой тип
(шаблон класса)
is_layout_compatible
(C++20)
проверяет, являются ли два типа совместимыми по структуре
(шаблон класса)
is_pointer_interconvertible_base_of
(C++20)
проверяет, является ли тип указателем-совместимым (начальным) базовым типом другого типа
(шаблон класса)
is_invocableis_invocable_ris_nothrow_invocableis_nothrow_invocable_r
(C++17)
проверяет, можно ли вызвать тип (как если бы с помощью std::invoke) с заданными типами аргументов
(шаблон класса)
Спецификаторы const и volatile
remove_cvremove_constremove_volatile
(C++11)(C++11)(C++11)
удаляет спецификаторы const и/или volatile из заданного типа
(шаблон класса)
add_cvadd_constadd_volatile
(C++11)(C++11)(C++11)
добавляет спецификаторы const и/или volatile к заданному типу
(шаблон класса)
Ссылочные типы
remove_reference
(C++11)
удаляет ссылку из заданного типа
(шаблон класса)
add_lvalue_referenceadd_rvalue_reference
(C++11)(C++11)
добавляет ссылку lvalue или rvalue к заданному типу
(шаблон класса)
Указатели
remove_pointer
(C++11)
удаляет указатель из заданного типа
(шаблон класса)
add_pointer
(C++11)
добавляет указатель к заданному типу
(шаблон класса)
Модификаторы знака
make_signed
(C++11)
делает заданный целочисленный тип знаковым
(шаблон класса)
make_unsigned
(C++11)
делает заданный целочисленный тип беззнаковым
(шаблон класса)
Массивы
remove_extent
(C++11)
удаляет один размер из заданного типа массива
(шаблон класса)
remove_all_extents
(C++11)
удаляет все размеры из заданного типа массива
(шаблон класса)
Различные преобразования
aligned_storage
(C++11)(устарело в C++23)
определяет тип, подходящий для использования в качестве неинициализированного хранилища для типов заданного размера
(шаблон класса)
aligned_union
(C++11)(устарело в C++23)
определяет тип, подходящий для использования в качестве неинициализированного хранилища для всех указанных типов
(шаблон класса)
decay
(C++11)
применяет преобразования типов, как при передаче аргумента функции по значению
(шаблон класса)
remove_cvref
(C++20)
объединяет std::remove_cv и std::remove_reference
(шаблон класса)
enable_if
(C++11)
условно исключает перегрузку функции или специализацию шаблона из разрешения перегрузки
(шаблон класса)
conditional
(C++11)
выбирает один тип или другой на основе булевого значения во время компиляции
(шаблон класса)
common_type
(C++11)
определяет общий тип группы типов
(шаблон класса)
common_referencebasic_common_reference
(C++20)
определяет общий тип ссылки группы типов
(шаблон класса)
underlying_type
(C++11)
получает базовый целочисленный тип для заданного типа перечисления
(шаблон класса)
result_ofinvoke_result
(C++11)(удалено в C++20)(C++17)
вычисляет тип результата вызова вызываемого объекта с набором аргументов
(шаблон класса)
void_t
(C++17)
шаблон-псевдоним void для произвольного числа аргументов
(шаблон псевдонима)
type_identity
(C++20)
возвращает аргумент типа без изменений
(шаблон класса)
Операции с характеристиками
conjunction
(C++17)
многоаргументная логическая AND метафункция
(шаблон класса)
disjunction
(C++17)
многоаргументная логическая OR метафункция
(шаблон класса)
negation
(C++17)
логическая NOT метафункция
(шаблон класса)

Функции

Связи между членами
is_pointer_interconvertible_with_class
(C++20)
проверяет, могут ли объекты данного типа быть преобразованы к указателям на указанный подобъект того же типа
(шаблон функции)
is_corresponding_member
(C++20)
проверяет, соответствуют ли два указанных члена друг другу в общем начальном подпоследовательности двух указанных типов
(шаблон функции)
Контекст постоянного вычисления
is_constant_evaluated
(C++20)
определяет, происходит ли вызов в контексте постоянного вычисления
(функция)
is_within_lifetime
(C++26)
проверяет, находится ли указатель в пределах времени жизни объекта во время компиляции
(функция)

Синопсис

namespace std {
  // helper class
  template<class T, T v> struct integral_constant;
 
  template<bool B>
    using bool_constant = integral_constant<bool, B>;
  using true_type  = bool_constant<true>;
  using false_type = bool_constant<false>;
 
  // primary type categories
  template<class T> struct is_void;
  template<class T> struct is_null_pointer;
  template<class T> struct is_integral;
  template<class T> struct is_floating_point;
  template<class T> struct is_array;
  template<class T> struct is_pointer;
  template<class T> struct is_lvalue_reference;
  template<class T> struct is_rvalue_reference;
  template<class T> struct is_member_object_pointer;
  template<class T> struct is_member_function_pointer;
  template<class T> struct is_enum;
  template<class T> struct is_union;
  template<class T> struct is_class;
  template<class T> struct is_function;
 
  // composite type categories
  template<class T> struct is_reference;
  template<class T> struct is_arithmetic;
  template<class T> struct is_fundamental;
  template<class T> struct is_object;
  template<class T> struct is_scalar;
  template<class T> struct is_compound;
  template<class T> struct is_member_pointer;
 
  // type properties
  template<class T> struct is_const;
  template<class T> struct is_volatile;
  template<class T> struct is_trivial;
  template<class T> struct is_trivially_copyable;
  template<class T> struct is_standard_layout;
  template<class T> struct is_empty;
  template<class T> struct is_polymorphic;
  template<class T> struct is_abstract;
  template<class T> struct is_final;
  template<class T> struct is_aggregate;
 
  template<class T> struct is_signed;
  template<class T> struct is_unsigned;
  template<class T> struct is_bounded_array;
  template<class T> struct is_unbounded_array;
  template<class T> struct is_scoped_enum;
 
  template<class T, class... Args> struct is_constructible;
  template<class T> struct is_default_constructible;
  template<class T> struct is_copy_constructible;
  template<class T> struct is_move_constructible;
 
  template<class T, class U> struct is_assignable;
  template<class T> struct is_copy_assignable;
  template<class T> struct is_move_assignable;
 
  template<class T, class U> struct is_swappable_with;
  template<class T> struct is_swappable;
 
  template<class T> struct is_destructible;
 
  template<class T, class... Args> struct is_trivially_constructible;
  template<class T> struct is_trivially_default_constructible;
  template<class T> struct is_trivially_copy_constructible;
  template<class T> struct is_trivially_move_constructible;
 
  template<class T, class U> struct is_trivially_assignable;
  template<class T> struct is_trivially_copy_assignable;
  template<class T> struct is_trivially_move_assignable;
  template<class T> struct is_trivially_destructible;
 
  template<class T, class... Args> struct is_nothrow_constructible;
  template<class T> struct is_nothrow_default_constructible;
  template<class T> struct is_nothrow_copy_constructible;
  template<class T> struct is_nothrow_move_constructible;
 
  template<class T, class U> struct is_nothrow_assignable;
  template<class T> struct is_nothrow_copy_assignable;
  template<class T> struct is_nothrow_move_assignable;
 
  template<class T, class U> struct is_nothrow_swappable_with;
  template<class T> struct is_nothrow_swappable;
 
  template<class T> struct is_nothrow_destructible;
 
  template<class T> struct has_virtual_destructor;
 
  template<class T> struct has_unique_object_representations;
 
  template<class T, class U> struct reference_constructs_from_temporary;
  template<class T, class U> struct reference_converts_from_temporary;
 
  // type property queries
  template<class T> struct alignment_of;
  template<class T> struct rank;
  template<class T, unsigned I = 0> struct extent;
 
  // type relations
  template<class T, class U> struct is_same;
  template<class Base, class Derived> struct is_base_of;
  template<class From, class To> struct is_convertible;
  template<class From, class To> struct is_nothrow_convertible;
  template<class T, class U> struct is_layout_compatible;
  template<class Base, class Derived> struct is_pointer_interconvertible_base_of;
 
  template<class Fn, class... ArgTypes> struct is_invocable;
  template<class R, class Fn, class... ArgTypes> struct is_invocable_r;
 
  template<class Fn, class... ArgTypes> struct is_nothrow_invocable;
  template<class R, class Fn, class... ArgTypes> struct is_nothrow_invocable_r;
 
  // const-volatile modifications
  template<class T> struct remove_const;
  template<class T> struct remove_volatile;
  template<class T> struct remove_cv;
  template<class T> struct add_const;
  template<class T> struct add_volatile;
  template<class T> struct add_cv;
 
  template<class T>
    using remove_const_t    = typename remove_const<T>::type;
  template<class T>
    using remove_volatile_t = typename remove_volatile<T>::type;
  template<class T>
    using remove_cv_t       = typename remove_cv<T>::type;
  template<class T>
    using add_const_t       = typename add_const<T>::type;
  template<class T>
    using add_volatile_t    = typename add_volatile<T>::type;
  template<class T>
    using add_cv_t          = typename add_cv<T>::type;
 
  // reference modifications
  template<class T> struct remove_reference;
  template<class T> struct add_lvalue_reference;
  template<class T> struct add_rvalue_reference;
 
  template<class T>
    using remove_reference_t     = typename remove_reference<T>::type;
  template<class T>
    using add_lvalue_reference_t = typename add_lvalue_reference<T>::type;
  template<class T>
    using add_rvalue_reference_t = typename add_rvalue_reference<T>::type;
 
  // sign modifications
  template<class T> struct make_signed;
  template<class T> struct make_unsigned;
 
  template<class T>
    using make_signed_t   = typename make_signed<T>::type;
  template<class T>
    using make_unsigned_t = typename make_unsigned<T>::type;
 
  // array modifications
  template<class T> struct remove_extent;
  template<class T> struct remove_all_extents;
 
  template<class T>
    using remove_extent_t      = typename remove_extent<T>::type;
  template<class T>
    using remove_all_extents_t = typename remove_all_extents<T>::type;
 
  // pointer modifications
  template<class T> struct remove_pointer;
  template<class T> struct add_pointer;
 
  template<class T>
    using remove_pointer_t = typename remove_pointer<T>::type;
  template<class T>
    using add_pointer_t    = typename add_pointer<T>::type;
 
  // other transformations
  template<class T> struct type_identity;
  template<class T> struct remove_cvref;
  template<class T> struct decay;
  template<bool, class T = void> struct enable_if;
  template<bool, class T, class F> struct conditional;
  template<class... T> struct common_type;
  template<class T, class U, template<class> class TQual, template<class> class UQual>
    struct basic_common_reference { };
  template<class... T> struct common_reference;
  template<class T> struct underlying_type;
  template<class Fn, class... ArgTypes> struct invoke_result;
  template<class T> struct unwrap_reference;
  template<class T> struct unwrap_ref_decay;
 
  template<class T>
    using type_identity_t    = typename type_identity<T>::type;
  template<class T>
    using remove_cvref_t     = typename remove_cvref<T>::type;
  template<class T>
    using decay_t            = typename decay<T>::type;
  template<bool b, class T = void>
    using enable_if_t        = typename enable_if<b, T>::type;
  template<bool b, class T, class F>
    using conditional_t      = typename conditional<b, T, F>::type;
  template<class... T>
    using common_type_t      = typename common_type<T...>::type;
  template<class... T>
    using common_reference_t = typename common_reference<T...>::type;
  template<class T>
    using underlying_type_t  = typename underlying_type<T>::type;
  template<class Fn, class... ArgTypes>
    using invoke_result_t    = typename invoke_result<Fn, ArgTypes...>::type;
  template<class T>
    using unwrap_reference_t = typename unwrap_reference<T>::type;
  template<class T>
    using unwrap_ref_decay_t = typename unwrap_ref_decay<T>::type;
  template<class...>
    using void_t             = void;
 
  // logical operator traits
  template<class... B> struct conjunction;
  template<class... B> struct disjunction;
  template<class B> struct negation;
 
  // primary type categories
  template<class T>
    inline constexpr bool is_void_v = is_void<T>::value;
  template<class T>
    inline constexpr bool is_null_pointer_v = is_null_pointer<T>::value;
  template<class T>
    inline constexpr bool is_integral_v = is_integral<T>::value;
  template<class T>
    inline constexpr bool is_floating_point_v = is_floating_point<T>::value;
  template<class T>
    inline constexpr bool is_array_v = is_array<T>::value;
  template<class T>
    inline constexpr bool is_pointer_v = is_pointer<T>::value;
  template<class T>
    inline constexpr bool is_lvalue_reference_v = is_lvalue_reference<T>::value;
  template<class T>
    inline constexpr bool is_rvalue_reference_v = is_rvalue_reference<T>::value;
  template<class T>
    inline constexpr bool is_member_object_pointer_v = is_member_object_pointer<T>::value;
  template<class T>
    inline constexpr bool is_member_function_pointer_v = is_member_function_pointer<T>::value;
  template<class T>
    inline constexpr bool is_enum_v = is_enum<T>::value;
  template<class T>
    inline constexpr bool is_union_v = is_union<T>::value;
  template<class T>
    inline constexpr bool is_class_v = is_class<T>::value;
  template<class T>
    inline constexpr bool is_function_v = is_function<T>::value;
 
  // composite type categories
  template<class T>
    inline constexpr bool is_reference_v = is_reference<T>::value;
  template<class T>
    inline constexpr bool is_arithmetic_v = is_arithmetic<T>::value;
  template<class T>
    inline constexpr bool is_fundamental_v = is_fundamental<T>::value;
  template<class T>
    inline constexpr bool is_object_v = is_object<T>::value;
  template<class T>
    inline constexpr bool is_scalar_v = is_scalar<T>::value;
  template<class T>
    inline constexpr bool is_compound_v = is_compound<T>::value;
  template<class T>
    inline constexpr bool is_member_pointer_v = is_member_pointer<T>::value;
 
  // type properties
  template<class T>
    inline constexpr bool is_const_v = is_const<T>::value;
  template<class T>
    inline constexpr bool is_volatile_v = is_volatile<T>::value;
  template<class T>
    inline constexpr bool is_trivial_v = is_trivial<T>::value;
  template<class T>
    inline constexpr bool is_trivially_copyable_v = is_trivially_copyable<T>::value;
  template<class T>
    inline constexpr bool is_standard_layout_v = is_standard_layout<T>::value;
  template<class T>
    inline constexpr bool is_empty_v = is_empty<T>::value;
  template<class T>
    inline constexpr bool is_polymorphic_v = is_polymorphic<T>::value;
  template<class T>
    inline constexpr bool is_abstract_v = is_abstract<T>::value;
  template<class T>
    inline constexpr bool is_final_v = is_final<T>::value;
  template<class T>
    inline constexpr bool is_aggregate_v = is_aggregate<T>::value;
  template<class T>
    inline constexpr bool is_signed_v = is_signed<T>::value;
  template<class T>
    inline constexpr bool is_unsigned_v = is_unsigned<T>::value;
  template<class T>
    inline constexpr bool is_bounded_array_v = is_bounded_array<T>::value;
  template<class T>
    inline constexpr bool is_unbounded_array_v = is_unbounded_array<T>::value;
  template<class T>
    inline constexpr bool is_scoped_enum_v = is_scoped_enum<T>::value;
  template<class T, class... Args>
    inline constexpr bool is_constructible_v = is_constructible<T, Args...>::value;
  template<class T>
    inline constexpr bool is_default_constructible_v = is_default_constructible<T>::value;
  template<class T>
    inline constexpr bool is_copy_constructible_v = is_copy_constructible<T>::value;
  template<class T>
    inline constexpr bool is_move_constructible_v = is_move_constructible<T>::value;
  template<class T, class U>
    inline constexpr bool is_assignable_v = is_assignable<T, U>::value;
  template<class T>
    inline constexpr bool is_copy_assignable_v = is_copy_assignable<T>::value;
  template<class T>
    inline constexpr bool is_move_assignable_v = is_move_assignable<T>::value;
  template<class T, class U>
    inline constexpr bool is_swappable_with_v = is_swappable_with<T, U>::value;
  template<class T>
    inline constexpr bool is_swappable_v = is_swappable<T>::value;
  template<class T>
    inline constexpr bool is_destructible_v = is_destructible<T>::value;
  template<class T, class... Args>
    inline constexpr bool is_trivially_constructible_v
      = is_trivially_constructible<T, Args...>::value;
  template<class T>
    inline constexpr bool is_trivially_default_constructible_v
      = is_trivially_default_constructible<T>::value;
  template<class T>
    inline constexpr bool is_trivially_copy_constructible_v
      = is_trivially_copy_constructible<T>::value;
  template<class T>
    inline constexpr bool is_trivially_move_constructible_v
      = is_trivially_move_constructible<T>::value;
  template<class T, class U>
    inline constexpr bool is_trivially_assignable_v = is_trivially_assignable<T, U>::value;
  template<class T>
    inline constexpr bool is_trivially_copy_assignable_v
      = is_trivially_copy_assignable<T>::value;
  template<class T>
    inline constexpr bool is_trivially_move_assignable_v
      = is_trivially_move_assignable<T>::value;
  template<class T>
    inline constexpr bool is_trivially_destructible_v = is_trivially_destructible<T>::value;
  template<class T, class... Args>
    inline constexpr bool is_nothrow_constructible_v
      = is_nothrow_constructible<T, Args...>::value;
  template<class T>
    inline constexpr bool is_nothrow_default_constructible_v
      = is_nothrow_default_constructible<T>::value;
  template<class T>
    inline constexpr bool is_nothrow_copy_constructible_v
      = is_nothrow_copy_constructible<T>::value;
  template<class T>
    inline constexpr bool is_nothrow_move_constructible_v
      = is_nothrow_move_constructible<T>::value;
  template<class T, class U>
    inline constexpr bool is_nothrow_assignable_v = is_nothrow_assignable<T, U>::value;
  template<class T>
    inline constexpr bool is_nothrow_copy_assignable_v = is_nothrow_copy_assignable<T>::value;
  template<class T>
    inline constexpr bool is_nothrow_move_assignable_v = is_nothrow_move_assignable<T>::value;
  template<class T, class U>
    inline constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<T, U>::value;
  template<class T>
    inline constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<T>::value;
  template<class T>
    inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<T>::value;
  template<class T>
    inline constexpr bool has_virtual_destructor_v = has_virtual_destructor<T>::value;
  template<class T>
    inline constexpr bool has_unique_object_representations_v
      = has_unique_object_representations<T>::value;
  template<class T, class U>
    inline constexpr bool reference_constructs_from_temporary_v
      = reference_constructs_from_temporary<T, U>::value;
  template<class T, class U>
    inline constexpr bool reference_converts_from_temporary_v
      = reference_converts_from_temporary<T, U>::value;
 
  // type property queries
  template<class T>
    inline constexpr size_t alignment_of_v = alignment_of<T>::value;
  template<class T>
    inline constexpr size_t rank_v = rank<T>::value;
  template<class T, unsigned I = 0>
    inline constexpr size_t extent_v = extent<T, I>::value;
 
  // type relations
  template<class T, class U>
    inline constexpr bool is_same_v = is_same<T, U>::value;
  template<class Base, class Derived>
    inline constexpr bool is_base_of_v = is_base_of<Base, Derived>::value;
  template<class From, class To>
    inline constexpr bool is_convertible_v = is_convertible<From, To>::value;
  template<class From, class To>
    inline constexpr bool is_nothrow_convertible_v = is_nothrow_convertible<From, To>::value;
  template<class T, class U>
    inline constexpr bool is_layout_compatible_v = is_layout_compatible<T, U>::value;
  template<class Base, class Derived>
    inline constexpr bool is_pointer_interconvertible_base_of_v
      = is_pointer_interconvertible_base_of<Base, Derived>::value;
  template<class Fn, class... ArgTypes>
    inline constexpr bool is_invocable_v = is_invocable<Fn, ArgTypes...>::value;
  template<class R, class Fn, class... ArgTypes>
    inline constexpr bool is_invocable_r_v = is_invocable_r<R, Fn, ArgTypes...>::value;
  template<class Fn, class... ArgTypes>
    inline constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<Fn, ArgTypes...>::value;
  template<class R, class Fn, class... ArgTypes>
    inline constexpr bool is_nothrow_invocable_r_v
      = is_nothrow_invocable_r<R, Fn, ArgTypes...>::value;
 
  // logical operator traits
  template<class... B>
    inline constexpr bool conjunction_v = conjunction<B...>::value;
  template<class... B>
    inline constexpr bool disjunction_v = disjunction<B...>::value;
  template<class B>
    inline constexpr bool negation_v = negation<B>::value;
 
  // member relationships
  template<class S, class M>
    constexpr bool is_pointer_interconvertible_with_class(M S::*m) noexcept;
  template<class S1, class S2, class M1, class M2>
    constexpr bool is_corresponding_member(M1 S1::*m1, M2 S2::*m2) noexcept;
 
  // constant evaluation context
  constexpr bool is_constant_evaluated() noexcept;
  consteval bool is_within_lifetime(const auto*) noexcept;
}

Шаблон класса std::integral_constant

namespace std {
  template <class T, T v>
  struct integral_constant {
    static constexpr T value = v;
    using value_type = T;
    using type = integral_constant<T, v>;
    constexpr operator value_type() const noexcept { return value; }
    constexpr value_type operator()() const noexcept { return value; }
  };
}

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/header/type_traits

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API