type_traits.hpp

Extensions on the standard library type traits to handle Empirical classes (such as Ptr).

Typedefs

template<typename T>
using IsIterable = decltype(detail::is_iterable_impl<T>(0))

Determine if a type is iterable.

template<typename T>
using remove_std_function_t = typename remove_std_function_type<T>::type
template<typename T>
using element_t = typename element_type<T>::type
template<typename T>
using is_pointer = is_ptr_type<T>
template<typename T>
using remove_ptr_type_t = typename remove_ptr_type<T>::type
template<typename T>
using remove_pointer_t = remove_ptr_type_t<T>
template<size_t BIT_COUNT, typename DEFAULT = void>
using uint_bit_count_t = typename uint_bit_count<BIT_COUNT, DEFAULT>::type
template<size_t BIT_COUNT, typename DEFAULT = void>
using int_bit_count_t = typename int_bit_count<BIT_COUNT, DEFAULT>::type
template<typename T, typename MATCH_T>
using match_const_t = typename match_const<T, MATCH_T>::type
template<typename ...Variadics>
using variadic_concat_t = typename variadic_concat<Variadics...>::type
template<typename Variadic, template<typename> class Filter>
using variadic_filter_t = typename variadic_filter<Variadic, Filter>::type
template<typename Variadic, template<typename, typename> class ...Cmp>
using variadic_remove_duplicates_t = typename variadic_remove_duplicates<Variadic, Cmp...>::type
template<template<typename, typename> class Cmp, typename ...U>
using variadic_union_t = typename variadic_union<Cmp, U...>::type
template<template<typename, typename> class Cmp, typename ...U>
using variadic_intersection_t = typename variadic_intersection<Cmp, U...>::type

Functions

template<typename T>
constexpr bool is_ptr_type_v()
template<typename T>
constexpr bool is_ptr_type_v(const T&)
template<typename T>
auto &remove_ptr_value(T &value)

Convert a value to a non-pointer if and only if it is one.

Variables

template<typename Needle, typename Haystack, template<typename, typename> class ...Cmp>
constexpr bool variadic_contains_v = {variadic_contains<Needle, Haystack, Cmp...>::value}
template<typename Needle, typename Haystack, template<typename, typename> class ...Cmp>
static constexpr auto variadic_index_of_v = {variadic_index_of<Needle, Haystack, Cmp...>::value}
template<typename T, typename = void>
struct HasToString : public std::false_type
#include <type_traits.hpp>
template<typename T>
struct HasToString<decoy_t<T, decltype(std::declval<T>().ToString())>> : public std::true_type
#include <type_traits.hpp>
template<typename T, typename = void>
struct HasToDouble : public std::false_type
#include <type_traits.hpp>
template<typename T>
struct HasToDouble<decoy_t<T, decltype(std::declval<T>().ToDouble())>> : public std::true_type
#include <type_traits.hpp>
template<typename>
struct is_std_function : public std::false_type
#include <type_traits.hpp>

Determine if a type passed in is an std::function type (vs a lambda or a raw function)

template<typename ...Ts>
struct is_std_function<std::function<Ts...>> : public std::true_type
#include <type_traits.hpp>
template<typename T>
struct remove_std_function_type
#include <type_traits.hpp>

Convert std::function to base function type.

Public Types

using type = T
template<typename T>
struct remove_std_function_type<std::function<T>>
#include <type_traits.hpp>

Public Types

using type = T
template<typename T>
struct element_type
#include <type_traits.hpp>

Public Types

using type = T
template<template<typename...> class TMPL, typename T>
struct element_type<TMPL<T>>
#include <type_traits.hpp>

Public Types

using type = T
template<typename>
struct is_emp_vector : public std::false_type
#include <type_traits.hpp>

Determine if we have an vector.

template<typename T, typename ...Ts>
struct is_emp_vector<vector<T, Ts...>> : public std::true_type
#include <type_traits.hpp>
template<typename>
struct is_span : public std::false_type
#include <type_traits.hpp>

Determine if we have a span.

template<typename T>
struct is_span<std::span<T>> : public std::true_type
#include <type_traits.hpp>
template<typename>
struct is_ptr_type : public std::false_type
#include <type_traits.hpp>
template<typename T>
struct is_ptr_type<T*> : public std::true_type
#include <type_traits.hpp>
template<typename T>
struct is_ptr_type<T*const> : public std::true_type
#include <type_traits.hpp>
template<typename T>
struct is_ptr_type<Ptr<T>> : public std::true_type
#include <type_traits.hpp>
template<typename T>
struct remove_ptr_type
#include <type_traits.hpp>

Public Types

using type = T
template<typename T>
struct remove_ptr_type<T*>
#include <type_traits.hpp>

Public Types

using type = T
template<typename T>
struct remove_ptr_type<T*const>
#include <type_traits.hpp>

Public Types

using type = const T
template<typename T>
struct remove_ptr_type<Ptr<T>>
#include <type_traits.hpp>

Public Types

using type = T
template<size_t BIT_COUNT, typename DEFAULT = void>
struct uint_bit_count
#include <type_traits.hpp>

Figure out which type is an unsigned integer with a specified number of bits.

Public Types

using type = DEFAULT
template<>
struct uint_bit_count<8>
#include <type_traits.hpp>

Public Types

using type = uint8_t
template<>
struct uint_bit_count<16>
#include <type_traits.hpp>

Public Types

using type = uint16_t
template<>
struct uint_bit_count<32>
#include <type_traits.hpp>

Public Types

using type = uint32_t
template<>
struct uint_bit_count<64>
#include <type_traits.hpp>

Public Types

using type = uint64_t
template<size_t BIT_COUNT, typename DEFAULT = void>
struct int_bit_count
#include <type_traits.hpp>

Figure out which type is an integer with a specified number of bits.

Public Types

using type = DEFAULT
template<>
struct int_bit_count<8>
#include <type_traits.hpp>

Public Types

using type = int8_t
template<>
struct int_bit_count<16>
#include <type_traits.hpp>

Public Types

using type = int16_t
template<>
struct int_bit_count<32>
#include <type_traits.hpp>

Public Types

using type = int32_t
template<>
struct int_bit_count<64>
#include <type_traits.hpp>

Public Types

using type = int64_t
template<typename T, typename MATCH_T>
struct match_const
#include <type_traits.hpp>

Match the constness of another type.

Public Types

using type = std::remove_const_t<T>
template<typename T, typename MATCH_T>
struct match_const<T, const MATCH_T>
#include <type_traits.hpp>

Public Types

using type = std::add_const_t<T>
template<typename T1, typename T2>
struct ptr_pair
#include <type_traits.hpp>

Public Static Functions

static inline constexpr bool Same()
static inline constexpr bool SameBase()
static inline bool ConvertOK(T1 *ptr)
template<typename T>
struct ptr_pair<T, T>
#include <type_traits.hpp>

Public Static Functions

static inline constexpr bool Same()
static inline constexpr bool SameBase()
static inline constexpr bool ConvertOK(T*)
template<typename T>
struct ptr_pair<T, const T>
#include <type_traits.hpp>

Public Static Functions

static inline constexpr bool Same()
static inline constexpr bool SameBase()
static inline constexpr bool ConvertOK(T*)
template<typename T>
struct ptr_pair<const T, T>
#include <type_traits.hpp>

Public Static Functions

static inline constexpr bool Same()
static inline constexpr bool SameBase()
static inline constexpr bool ConvertOK(T*)
template<typename Fn, typename ...Args>
struct is_invocable : public decltypedetail::is_invocable_helper::value
#include <type_traits.hpp>
template<typename Needle, template<typename...> class Variadic, typename ...U, template<typename, typename> class Cmp>
struct variadic_contains<Needle, Variadic<U...>, Cmp> : public __impl_variadics_type_traits::variadic_contains<Needle, __impl_variadics_type_traits::pack<U...>, Cmp>
#include <type_traits.hpp>
template<template<typename...> class Variadic, class ...A, class ...Rest>
struct variadic_concat<Variadic<A...>, Rest...>
#include <type_traits.hpp>

Public Types

using type = __impl_variadics_type_traits::FromPackType<Variadic, typename __impl_variadics_type_traits::variadic_concat<Variadic, __impl_variadics_type_traits::pack<__impl_variadics_type_traits::pack<A...>, Rest...>>::type>
template<template<typename...> class Variadic, typename ...U, template<typename> class Filter>
struct variadic_filter<Variadic<U...>, Filter>
#include <type_traits.hpp>

Public Types

using type = __impl_variadics_type_traits::FromPackType<Variadic, typename __impl_variadics_type_traits::variadic_filter<__impl_variadics_type_traits::pack<>, __impl_variadics_type_traits::pack<U...>, Filter>::type>
template<template<typename...> class Variadic, typename ...U, template<typename, typename> class Cmp>
struct variadic_remove_duplicates<Variadic<U...>, Cmp>
#include <type_traits.hpp>

Public Types

using type = __impl_variadics_type_traits::FromPackType<Variadic, typename __impl_variadics_type_traits::variadic_remove_duplicates<__impl_variadics_type_traits::pack<>, __impl_variadics_type_traits::pack<U...>, Cmp>::type>
template<template<typename...> class Variadic, template<typename, typename> class Cmp, typename ...U>
struct variadic_union<Cmp, Variadic<U...>>
#include <type_traits.hpp>

Public Types

using type = __impl_variadics_type_traits::FromPackType<Variadic, variadic_remove_duplicates_t<__impl_variadics_type_traits::pack<U...>, Cmp>>
template<template<typename...> class Variadic, template<typename, typename> class Cmp, typename ...U0, typename U1, typename ...U>
struct variadic_union<Cmp, Variadic<U0...>, U1, U...>
#include <type_traits.hpp>

Public Types

using type = __impl_variadics_type_traits::FromPackType<Variadic, typename __impl_variadics_type_traits::variadic_union<Cmp, __impl_variadics_type_traits::pack<U0...>, __impl_variadics_type_traits::ToPackType<Variadic, U1>, __impl_variadics_type_traits::ToPackType<Variadic, U>...>::type>
template<template<typename...> class Variadic, template<typename, typename> class Cmp, typename ...U>
struct variadic_intersection<Cmp, Variadic<U...>>
#include <type_traits.hpp>

Public Types

using type = __impl_variadics_type_traits::FromPackType<Variadic, variadic_remove_duplicates_t<__impl_variadics_type_traits::pack<U...>, Cmp>>
template<template<typename...> class Variadic, template<typename, typename> class Cmp, typename ...U0, typename U1, typename ...U>
struct variadic_intersection<Cmp, Variadic<U0...>, U1, U...>
#include <type_traits.hpp>

Public Types

using type = __impl_variadics_type_traits::FromPackType<Variadic, typename __impl_variadics_type_traits::variadic_intersection<Cmp, __impl_variadics_type_traits::pack<U0...>, __impl_variadics_type_traits::ToPackType<Variadic, U1>, __impl_variadics_type_traits::ToPackType<Variadic, U>...>::type>
template<typename Needle, template<typename...> class Haystack, typename ...U, template<typename, typename> class Cmp>
struct variadic_index_of<Needle, Haystack<U...>, Cmp> : public __impl_variadics_type_traits::variadic_index_of<0, Needle, __impl_variadics_type_traits::pack<U...>, Cmp>
#include <type_traits.hpp>