|
| struct | integral_constant< T, Value > |
| | 整数常量包装器 更多...
|
| struct | enable_if< Test, T > |
| | 条件启用模板 更多...
|
| struct | conditional< Test, T1, T2 > |
| | 条件选择类型 更多...
|
| struct | negation< T > |
| | 逻辑非包装器 更多...
|
| struct | is_same< T1, T2 > |
| | 判断两个类型是否相同 更多...
|
| struct | type_identity< T > |
| | 类型标识包装器 更多...
|
| struct | is_any_of< T, Types > |
| | 判断类型是否在类型集合中 更多...
|
| struct | disjunction< Args > |
| | 类型集合的逻辑或操作 更多...
|
| struct | conjunction< Args > |
| | 类型集合的逻辑与操作 更多...
|
| struct | remove_const< T > |
| | 移除const限定符 更多...
|
| struct | remove_volatile< T > |
| | 移除volatile限定符 更多...
|
| struct | remove_cv< T > |
| | 移除const和volatile限定符 更多...
|
| struct | remove_reference< T > |
| | 移除引用限定符 更多...
|
| struct | remove_cvref< T > |
| | 同时移除cv和引用限定符的类型包装 更多...
|
| struct | remove_extent< T > |
| | 移除数组的最外层维度 更多...
|
| struct | remove_all_extents< T > |
| | 移除数组的所有维度 更多...
|
| struct | remove_pointer< T > |
| | 移除指针限定符 更多...
|
| struct | remove_function_qualifiers< T > |
| | 移除函数类型的限定符 更多...
|
| struct | is_void< T > |
| | 判断类型是否为void 更多...
|
| struct | package< T, Dummy > |
| | 类型包装器模板 更多...
|
| struct | is_packaged< T > |
| | 判断类型是否被包装 更多...
|
| struct | unpackage< T, Dummy > |
| | 类型解包器模板 更多...
|
| struct | is_unpackaged< T > |
| | 判断类型是否被解包 更多...
|
| struct | is_character< T > |
| | 判断类型是否为字符类型 更多...
|
| struct | is_standard_character< T > |
| | 判断类型是否为标准字符类型 更多...
|
| struct | is_boolean< T > |
| | 判断类型是否为布尔类型 更多...
|
| struct | is_standard_integral< T > |
| | 判断类型是否为标准整数类型 更多...
|
| struct | is_integral< T > |
| | 判断类型是否为整数类型 更多...
|
| struct | is_floating_point< T > |
| | 判断类型是否为浮点数类型 更多...
|
| struct | is_arithmetic< T > |
| | 判断类型是否为算术类型 更多...
|
| struct | is_signed< T > |
| | 判断类型是否为有符号类型 更多...
|
| struct | is_unsigned< T > |
| | 判断类型是否为无符号类型 更多...
|
| struct | add_const< T > |
| | 添加const限定符 更多...
|
| struct | add_volatile< T > |
| | 添加volatile限定符 更多...
|
| struct | add_cv< T > |
| | 同时添加const和volatile限定符 更多...
|
| struct | add_reference< T, Dummy > |
| | 添加引用限定符 更多...
|
| struct | add_lvalue_reference< T > |
| | 添加左值引用 更多...
|
| struct | add_rvalue_reference< T > |
| | 添加右值引用 更多...
|
| struct | add_pointer< T, Dummy > |
| | 添加指针限定符 更多...
|
| struct | rank< T > |
| | 查询数组的维度数 更多...
|
| struct | extent< T, Idx > |
| | 查询数组指定维度的大小 更多...
|
| struct | get_ptr_difference< T, Dummy > |
| | 获取指针的差值类型 更多...
|
| struct | get_rebind_type< T, U, Dummy > |
| | 获取指针的重新绑定类型 更多...
|
| struct | is_bounded_array< T > |
| | 判断类型是否为有界数组 更多...
|
| struct | is_unbounded_array< T > |
| | 判断类型是否为无界数组 更多...
|
| struct | is_array< T > |
| | 判断类型是否为数组类型 更多...
|
| struct | is_lvalue_reference< T > |
| | 判断类型是否为左值引用 更多...
|
| struct | is_rvalue_reference< T > |
| | 判断类型是否为右值引用 更多...
|
| struct | is_reference< T > |
| | 判断类型是否为引用类型 更多...
|
| struct | is_null_pointer< T > |
| | 判断类型是否为nullptr_t 更多...
|
| struct | is_pointer< T > |
| | 判断类型是否为指针类型 更多...
|
| struct | is_enum< T > |
| | 判断类型是否为枚举类型 更多...
|
| struct | is_integral_like< T > |
| | 判断类型是否为类整数类型 更多...
|
| struct | is_union< T > |
| | 判断类型是否为联合类型 更多...
|
| struct | is_class< T > |
| | 判断类型是否为类类型 更多...
|
| struct | is_fundamental< T > |
| | 判断类型是否为基本类型 更多...
|
| struct | is_compound< T > |
| | 判断类型是否为复合类型 更多...
|
| struct | is_const< T > |
| | 判断类型是否被const限定 更多...
|
| struct | is_volatile< T > |
| | 判断类型是否被volatile限定 更多...
|
| struct | is_function< T > |
| | 判断类型是否为函数类型 更多...
|
| struct | is_allocable< T > |
| | 判断类型是否可以进行内存分配 更多...
|
| struct | is_object< T > |
| | 判断类型是否为对象类型 更多...
|
| struct | is_cstring< T > |
| | 判断类型是否为C风格字符串类型 更多...
|
| struct | is_scalar< T > |
| | 判断类型是否为标量类型 更多...
|
| struct | is_empty< T > |
| | 判断类型是否为空类型 更多...
|
| struct | is_polymorphic< T > |
| | 判断类型是否为多态类型 更多...
|
| struct | is_abstract< T > |
| | 判断类型是否为抽象类型 更多...
|
| struct | is_final< T > |
| | 判断类型是否被final限定 更多...
|
| struct | underlying_type< T > |
| | 获取枚举类型的底层整数类型 更多...
|
| struct | is_standard_layout< T > |
| | 判断类型是否符合标准布局 更多...
|
| struct | is_pod< T > |
| | 判断类型是否为POD类型 更多...
|
| struct | has_unique_object_representations< T > |
| | 判断类型是否具有唯一的对象表示 更多...
|
| struct | is_base_of< Base, Derived > |
| | 判断Base是否是Derived的基类 更多...
|
| struct | is_trivial< T > |
| | 判断类型是否为平凡类型 更多...
|
| struct | is_trivially_copyable< T > |
| | 判断类型是否为平凡可复制类型 更多...
|
| struct | has_virtual_destructor< T > |
| | 判断类型是否具有虚析构函数 更多...
|
| struct | is_constructible< T, Args > |
| | 判断类型是否可以使用指定参数构造 更多...
|
| struct | is_copy_constructible< T > |
| | 判断类型是否可复制构造 更多...
|
| struct | is_default_constructible< T > |
| | 判断类型是否可默认构造 更多...
|
| struct | is_implicitly_default_constructible< T, Dummy > |
| | 判断类型是否可隐式默认构造 更多...
|
| struct | is_move_constructible< T > |
| | 判断类型是否可移动构造 更多...
|
| struct | is_assignable< To, From > |
| | 判断类型是否可以使用指定类型的值进行赋值 更多...
|
| struct | is_copy_assignable< T > |
| | 判断类型是否可复制赋值 更多...
|
| struct | is_move_assignable< T > |
| | 判断类型是否可移动赋值 更多...
|
| struct | is_trivially_constructible< T, Args > |
| | 判断类型是否可以使用指定参数平凡构造 更多...
|
| struct | is_trivially_copy_constructible< T > |
| | 判断类型是否可平凡复制构造 更多...
|
| struct | is_trivially_default_constructible< T > |
| | 判断类型是否可平凡默认构造 更多...
|
| struct | is_trivially_move_constructible< T > |
| | 判断类型是否可平凡移动构造 更多...
|
| struct | is_trivially_assignable< To, From > |
| | 判断类型是否可以使用指定类型的值进行平凡赋值 更多...
|
| struct | is_trivially_copy_assignable< T > |
| | 判断类型是否可平凡复制赋值 更多...
|
| struct | is_trivially_move_assignable< T > |
| | 判断类型是否可平凡移动赋值 更多...
|
| struct | is_trivially_destructible< T > |
| | 判断类型是否可平凡析构 更多...
|
| struct | is_nothrow_copy_constructible< T > |
| | 判断类型是否可无异常复制构造 更多...
|
| struct | is_nothrow_move_constructible< T > |
| | 判断类型是否可无异常移动构造 更多...
|
| struct | is_nothrow_copy_assignable< T > |
| | 判断类型是否可无异常复制赋值 更多...
|
| struct | is_nothrow_move_assignable< T > |
| | 判断类型是否可无异常移动赋值 更多...
|
| struct | is_location_invariant< T > |
| | 判断类型是否是位置不变的 更多...
|
| struct | is_convertible< From, To > |
| | 判断类型From是否可以隐式转换为类型To 更多...
|
| struct | is_nothrow_convertible< From, To, IsConvertible, IsVoid > |
| | 判断类型From是否可以无异常地转换为类型To 更多...
|
| struct | is_nothrow_arrow< Iterator, Ptr, IsPtr > |
| | 判断迭代器的箭头运算符是否不会抛出异常 更多...
|
| struct | make_signed< T > |
| | 将类整数类型转换为对应的有符号类型 更多...
|
| struct | make_unsigned< T > |
| | 将类整数类型转换为对应的无符号类型 更多...
|
| struct | make_integer< Size, IsSigned > |
| | 根据大小和符号创建整数类型 更多...
|
| struct | alignment_of< T > |
| | 查询类型的对齐要求 更多...
|
| struct | aligned_storage< Len, Align > |
| | 创建指定大小和对齐要求的存储类型 更多...
|
| struct | aligned_storage< Len, Align >::type |
| | 实际的对齐存储类型 更多...
|
| struct | aligned_union< Len, Types > |
| | 创建可以容纳多种类型的对齐存储类型 更多...
|
| struct | aligned_union< Len, Types >::type |
| | 实际的对齐存储类型 更多...
|
| struct | decay< T > |
| | 模拟函数参数传递中的类型退化 更多...
|
| struct | is_specialization< T, Template > |
| | 判断类型T是否为模板Template的特化 更多...
|
| struct | is_swappable_from< T1, T2, Dummy > |
| | 判断是否可以调用swap从T1交换到T2 更多...
|
| struct | is_swappable_with< T1, T2 > |
| | 判断两个类型是否可以互相交换 更多...
|
| struct | is_swappable< T > |
| | 判断类型是否可以与自身交换 更多...
|
| struct | is_nothrow_swappable_from< T1, T2 > |
| | 判断是否可以无异常地从T1交换到T2 更多...
|
| struct | is_nothrow_swappable_with< T1, T2 > |
| | 判断两个类型是否可以无异常地互相交换 更多...
|
| struct | is_nothrow_swappable< T > |
| | 判断类型是否可以与自身无异常交换 更多...
|
| struct | is_ADL_swappable< T, Dummy > |
| | 判断类型是否支持通过ADL查找的swap 更多...
|
| struct | is_trivially_swappable< T > |
| | 判断类型是否可以平凡交换 更多...
|
| struct | is_allocator< Alloc, Dummy > |
| | 判断类型是否为分配器 更多...
|
| struct | is_incrementible< Iterator > |
| | 判断类型是否可以递增 更多...
|
| struct | is_decrementible< Iterator > |
| | 判断类型是否可以递减 更多...
|
| struct | is_iterable< Container > |
| | 判断类型是否可迭代 更多...
|
| struct | is_maplike< Map > |
| | 判断类型是否类似映射 更多...
|
| struct | has_construct< Alloc, T, Args > |
| | 判断分配器是否具有construct成员函数 更多...
|
| struct | has_base< T > |
| | 判断类型是否具有base成员函数 更多...
|
|
| template<bool Value> |
| using | bool_constant = integral_constant<bool, Value> |
| | 布尔常量包装器
|
|
using | true_type = bool_constant<true> |
| | 表示true的类型
|
|
using | false_type = bool_constant<false> |
| | 表示false的类型
|
| template<uint32_t Value> |
| using | uint32_constant = integral_constant<uint32_t, Value> |
| | 32位无符号整数常量包装器
|
| template<uint64_t Value> |
| using | uint64_constant = integral_constant<uint64_t, Value> |
| | 64位无符号整数常量包装器
|
| template<typename... Types> |
| using | void_t = void |
| | 将任意类型映射为void
|
|
template<bool Test, typename T = void> |
| using | enable_if_t = typename enable_if<Test, T>::type |
| | enable_if的便捷别名
|
|
template<bool Test, typename T1, typename T2> |
| using | conditional_t = typename conditional<Test, T1, T2>::type |
| | conditional的便捷别名
|
|
template<typename T> |
| using | type_identity_t = typename type_identity<T>::type |
| | type_identity的便捷别名
|
|
template<typename T> |
| using | remove_const_t = typename remove_const<T>::type |
| | remove_const的便捷别名
|
|
template<typename T> |
| using | remove_volatile_t = typename remove_volatile<T>::type |
| | remove_volatile的便捷别名
|
|
template<typename T> |
| using | remove_cv_t = typename remove_cv<T>::type |
| | remove_cv的便捷别名
|
| template<typename From, typename To> |
| using | copy_cv_t = typename remove_cv<From>::template bind_cv_t<To> |
| | 复制cv限定符
|
|
template<typename T> |
| using | remove_reference_t = typename remove_reference<T>::type |
| | remove_reference的便捷别名
|
| template<typename From, typename To> |
| using | copy_ref_t = typename remove_reference<From>::template bind_ref_t<To> |
| | 复制引用限定符
|
| template<typename From, typename To> |
| using | copy_cvref_t = copy_ref_t<From, copy_cv_t<From, To>> |
| | 同时复制cv和引用限定符
|
|
template<typename T> |
| using | remove_cvref_t = typename remove_cvref<T>::type |
| | remove_cvref的便捷别名
|
|
template<typename T> |
| using | remove_extent_t = typename remove_extent<T>::type |
| | remove_extent的便捷别名
|
|
template<typename T> |
| using | remove_all_extents_t = typename remove_all_extents<T>::type |
| | remove_all_extents的便捷别名
|
|
template<typename T> |
| using | remove_pointer_t = typename remove_pointer<T>::type |
| | remove_pointer的便捷别名
|
| template<typename From, typename To> |
| using | copy_pointer_t = typename remove_pointer<From>::template bind_pointer_t<To> |
| | 复制指针限定符
|
|
template<typename T> |
| using | remove_function_qualifiers_t = typename remove_function_qualifiers<T>::type |
| | remove_function_qualifiers的便捷别名
|
|
template<typename T> |
| using | package_t = typename package<T>::type |
| | package的便捷别名
|
|
template<typename T> |
| using | unpackage_t = typename unpackage<T>::type |
| | unpackage的便捷别名
|
|
template<typename T> |
| using | unpack_remove_cvref_t = unpackage_t<remove_cvref_t<T>> |
| | 同时解包并移除cv和引用限定符
|
|
template<typename T> |
| using | add_const_t = typename add_const<T>::type |
| | add_const的便捷别名
|
|
template<typename T> |
| using | add_volatile_t = typename add_volatile<T>::type |
| | add_volatile的便捷别名
|
|
template<typename T> |
| using | add_cv_t = typename add_cv<T>::type |
| | add_cv的类型别名
|
|
template<typename T> |
| using | add_lvalue_reference_t = typename add_reference<T>::lvalue |
| | add_lvalue_reference的便捷别名
|
|
template<typename T> |
| using | add_rvalue_reference_t = typename add_reference<T>::rvalue |
| | add_rvalue_reference的便捷别名
|
|
template<typename T> |
| using | add_pointer_t = typename add_pointer<T>::type |
| | add_pointer的便捷别名
|
|
template<typename Tmp> |
| using | get_first_temp_para_t = typename get_first_temp_para<Tmp>::type |
| | get_first_temp_para的便捷别名
|
|
template<typename... Types> |
| using | get_first_para_t = typename get_first_para<Types...>::type |
| | get_first_para的便捷别名
|
|
template<typename T> |
| using | get_ptr_difference_t = typename get_ptr_difference<T>::type |
| | get_ptr_difference的便捷别名
|
|
template<typename T, typename U> |
| using | replace_first_para_t = typename replace_first_para<T, U>::type |
| | replace_first_para的便捷别名
|
|
template<typename T, typename U> |
| using | get_rebind_type_t = typename get_rebind_type<T, U>::type |
| | get_rebind_type的便捷别名
|
|
template<typename T> |
| using | underlying_type_t = typename underlying_type<T>::type |
| | underlying_type的便捷别名
|
| template<typename ToElement, typename FromElement> |
| using | is_array_convertible = is_convertible<FromElement(*)[], ToElement(*)[]> |
| | 判断数组元素类型FromElement是否可以转换为ToElement
|
|
template<typename T> |
| using | make_signed_t = typename make_signed<T>::type |
| | make_signed的便捷别名
|
|
template<typename T> |
| using | make_unsigned_t = typename make_unsigned<T>::type |
| | make_unsigned的便捷别名
|
|
template<size_t Size, bool IsSigned = true> |
| using | make_integer_t = typename make_integer<Size, IsSigned>::type |
| | make_integer的便捷别名
|
|
template<size_t Len, size_t Align = alignof(_MSTL max_align_t)> |
| using | aligned_storage_t = typename aligned_storage<Len, Align>::type |
| | aligned_storage的便捷别名
|
|
template<size_t Len, typename... Types> |
| using | aligned_union_t = typename aligned_union<Len, Types...>::type |
| | aligned_union的便捷别名
|
|
template<typename T> |
| using | decay_t = typename decay<T>::type |
| | decay的便捷别名
|
| template<typename Default, template< typename... > class Op, typename... Args> |
| using | detected_or = _INNER __detector<Default, void, Op, Args...> |
| | 检测Op<Args...>是否有效,如果无效则使用Default类型
|
|
template<typename Default, template< typename... > class Op, typename... Args> |
| using | detected_or_t = typename detected_or<Default, Op, Args...>::type |
| | detected_or的便捷别名,返回检测到的类型或默认类型
|
| template<typename T1, typename T2> |
| using | common_ternary_operator_t = decltype(true ? _MSTL declval<T1>() : _MSTL declval<T2>()) |
| | 三目运算符的公共类型推导
|
|
template<typename... Types> |
| using | common_type_t = typename common_type<Types...>::type |
| | common_type的便捷别名
|
|
| template<typename T> |
| MSTL_NODISCARD constexpr add_const_t< T > & | as_const (T &val) noexcept |
| | 将值转换为const引用
|
| template<typename T> |
| add_rvalue_reference_t< T > | declval () noexcept |
| | 获取类型的右值引用,仅用于非求值上下文
|
| template<typename T> |
| type_identity_t< T > | declcopy (type_identity_t< T >) noexcept |
| | 获取类型的副本,仅用于非求值上下文
|
| template<typename T> |
| void | declvoid (type_identity_t< T >) noexcept |
| | 将类型映射为void,仅用于非求值上下文
|
| template<typename T> |
| MSTL_NODISCARD constexpr T && | forward (remove_reference_t< T > &x) noexcept |
| | 完美转发左值
|
| template<typename T> |
| MSTL_NODISCARD constexpr T && | forward (remove_reference_t< T > &&x) noexcept |
| | 完美转发右值
|
| template<typename T> |
| MSTL_NODISCARD constexpr remove_reference_t< T > && | move (T &&x) noexcept |
| | 无条件转换为右值引用
|
| template<typename T> |
| MSTL_NODISCARD constexpr conditional_t<!is_nothrow_move_constructible< T >::value &&is_copy_constructible< T >::value, const T &, T && > | move_if_noexcept (T &x) noexcept |
| | 在安全的情况下执行移动操作
|
| template<typename T> |
| MSTL_NODISCARD constexpr T * | addressof (T &x) noexcept |
| | 获取对象的地址
|
| template<typename T> |
| const T * | addressof (const T &&)=delete |
| | 禁止获取const右值的地址
|
| template<typename T, template< typename... > class Template> |
| constexpr bool | is_specialization_v () |
| | is_specialization的便捷函数模板
|
| template<typename T> |
| MSTL_CONSTEXPR14 enable_if_t< conjunction< is_move_constructible< T >, is_move_assignable< T > >::value > | swap (T &lhs, T &rhs) noexcept(is_nothrow_move_constructible< T >::value &&is_nothrow_move_assignable< T >::value) |
| | 交换两个相同类型的值
|
| template<typename T, size_t Size> |
| MSTL_CONSTEXPR14 enable_if_t< is_swappable< T >::value > | swap (T(&lhs)[Size], T(&rhs)[Size]) noexcept(is_nothrow_swappable< T >::value) |
| | 交换两个相同类型的数组
|
|
void | swap ()=delete |
| | 删除无参数的swap重载
|
| template<typename T, typename U = T> |
| MSTL_CONSTEXPR14 T | exchange (T &val, U &&new_val) noexcept(conjunction< is_nothrow_move_constructible< T >, is_nothrow_assignable< T &, U > >::value) |
| | 将新值赋给对象并返回旧值
|
| template<typename T, enable_if_t< is_default_constructible< T >::value, int > = 0> |
| constexpr T | initialize () noexcept(is_nothrow_default_constructible< T >::value) |
| | 返回类型T的默认初始化值
|
MSTL类型萃取
此文件提供了完整的类型萃取实现,用于在编译时查询和操作类型信息。
在文件 type_traits.hpp 中定义.