cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
type_traits.hpp File Reference

类型特征工具集合/Type traits utilities collection More...

#include <cstddef>
#include <ostream>
#include <type_traits>
Include dependency graph for type_traits.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  toolbox::traits::detail::has_type_impl< T, typename >
 检查类型是否具有type成员/Check if type has a type member More...
 
struct  toolbox::traits::detail::has_type_impl< T, void_t< typename T::type > >
 检查类型是否具有type成员(特化版本)/Check if type has a type member (specialization) More...
 
struct  toolbox::traits::detail::storage_traits< T >
 类型存储特征/Storage traits for types More...
 
struct  toolbox::traits::type_identity< T >
 类型标识特征/Type identity trait More...
 
struct  toolbox::traits::remove_reference< T >
 移除类型的引用/Remove reference from type More...
 
struct  toolbox::traits::has_toString< T >
 检查类型是否有toString方法(C++17之前版本)/Check if type has toString method (pre-C++17 version) More...
 
struct  toolbox::traits::remove_all_qualifiers< T >
 移除类型的所有限定符/Remove all qualifiers from type More...
 
struct  toolbox::traits::is_callable< T, typename >
 检查类型是否可调用/Check if type is callable More...
 
struct  toolbox::traits::is_callable< T, std::void_t< decltype(&T::operator())> >
 
struct  toolbox::traits::type_list< Ts >
 类型列表容器/Type list container More...
 
struct  toolbox::traits::function_traits< R(Args...)>
 普通函数的函数特征/Function traits for regular functions More...
 
struct  toolbox::traits::function_traits< R(C::*)(Args...)>
 成员函数的函数特征/Function traits for member functions More...
 
struct  toolbox::traits::has_size< T, typename >
 检查类型是否有size成员/Check if type has size member More...
 
struct  toolbox::traits::has_size< T, std::void_t< decltype(std::declval< T >().size())> >
 
struct  toolbox::traits::is_printable< T >
 检查类型是否可打印/Check if type is printable More...
 
class  toolbox::traits::enum_wrapper< EnumType >
 类型安全的枚举包装器/Type-safe enum wrapper More...
 
struct  toolbox::traits::is_heap_allocated< T >
 检查类型是否必须堆分配/Check if type must be heap allocated More...
 
struct  toolbox::traits::is_stack_allocated< T >
 检查类型是否可以栈分配/Check if type can be stack allocated More...
 
struct  toolbox::traits::is_const< T >
 检查类型是否为const限定/Check if type is const-qualified More...
 
struct  toolbox::traits::is_volatile< T >
 检查类型是否为volatile限定/Check if type is volatile-qualified More...
 
struct  toolbox::traits::is_const_volatile< T >
 检查类型是否同时具有const和volatile限定/Check if type is const-volatile qualified More...
 
struct  toolbox::traits::is_reference< T >
 检查类型是否为引用/Check if type is a reference More...
 
struct  toolbox::traits::is_array< T >
 检查类型是否为数组/Check if type is an array More...
 
struct  toolbox::traits::is_function< T >
 检查类型是否为函数/Check if type is a function More...
 
struct  toolbox::traits::is_member_pointer< T >
 检查类型是否为成员指针/Check if type is a member pointer More...
 
struct  toolbox::traits::is_pointer< T >
 检查类型是否为指针/Check if type is a pointer More...
 
struct  toolbox::traits::is_null_pointer< T >
 检查类型是否为std::nullptr_t/Check if type is std::nullptr_t More...
 
struct  toolbox::traits::is_iterable< T, typename >
 
struct  toolbox::traits::is_iterable< T, void_t< decltype(std::begin(std::declval< T >())), decltype(std::end(std::declval< T >()))> >
 
struct  toolbox::traits::is_less_than_comparable< T, U, typename >
 检查类型T和U是否支持小于运算符(<)/Check if types T and U support the less-than operator (<) More...
 
struct  toolbox::traits::is_less_than_comparable< T, U, std::void_t< decltype(std::declval< T >()< std::declval< U >())> >
 is_less_than_comparable 的特化:当T和U支持<运算符时为true_type/Specialization of is_less_than_comparable: true_type if T and U support < operator More...
 
struct  toolbox::traits::is_greater_than_comparable< T, U, typename >
 检查类型T和U是否支持大于运算符(>)/Check if types T and U support the greater-than operator (>) More...
 
struct  toolbox::traits::is_greater_than_comparable< T, U, std::void_t< decltype(std::declval< T >() > std::declval< U >())> >
 is_greater_than_comparable 的特化:当T和U支持>运算符时为true_type/Specialization of is_greater_than_comparable: true_type if T and U support > operator More...
 

Namespaces

namespace  toolbox
 
namespace  toolbox::traits
 
namespace  toolbox::traits::detail
 

Typedefs

template<typename... >
using toolbox::traits::detail::void_t = void
 用于SFINAE的空类型/Empty type for SFINAE
 
template<typename... >
using toolbox::traits::void_t = void
 

Variables

template<typename T >
constexpr bool toolbox::traits::is_iterable_v = is_iterable<T>::value
 
template<typename T , typename U = T>
constexpr bool toolbox::traits::is_less_than_comparable_v
 is_less_than_comparable 的变量模板/Variable template for is_less_than_comparable
 
template<typename T , typename U = T>
constexpr bool toolbox::traits::is_greater_than_comparable_v
 is_greater_than_comparable 的变量模板/Variable template for is_greater_than_comparable
 

Detailed Description

类型特征工具集合/Type traits utilities collection