Classes | Namespaces | Macros | Typedefs | Variables
TypeTraits.hpp File Reference

Defines type traits, some of which are future STL type_traits header. More...

#include <array>
#include <complex>
#include <cstddef>
#include <deque>
#include <forward_list>
#include <functional>
#include <future>
#include <list>
#include <map>
#include <memory>
#include <ostream>
#include <queue>
#include <set>
#include <stack>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "Utilities/NoSuchType.hpp"
#include "Utilities/Requires.hpp"
#include "Utilities/StlStreamDeclarations.hpp"
#include "Utilities/TMPL.hpp"

Go to the source code of this file.

Classes

struct  cpp17::void_type
 Mark a return type as being "void". In C++17 void is a regular type under certain circumstances, so this can be replaced by void then. More...
 
struct  cpp17::conjunction<... >
 A logical AND on the template parameters. More...
 
struct  cpp17::disjunction<... >
 A logical OR on the template parameters. More...
 
struct  cpp17::negation< B >
 Negate a bool_constant. More...
 
struct  cpp20::remove_cvref< T >
 
struct  tt::can_be_copy_constructed< T, typename >
 Check if T is copy constructible. More...
 
struct  tt::is_std_array< T >
 Check if type T is a std::array. More...
 
struct  tt::is_std_array_of_size< N, T >
 Check if type T is a std::array of a given size. More...
 
struct  tt::is_a< U, T >
 Check if type T is a template specialization of U More...
 
struct  tt::is_iterable< T, typename >
 Check if type T has a begin() and end() function. More...
 
struct  tt::is_comparable< T, typename >
 Check if type T has <, <=, >, >=, ==, !=. More...
 
struct  tt::has_equivalence< T, typename >
 Check if type T has operator== defined. More...
 
struct  tt::has_inequivalence< T, U >
 Check if type T has operator!= defined. More...
 
class  tt::is_callable< TT, TArgs >
 Check if a type T is callable, i.e. T(Args...) is evaluable. More...
 
struct  tt::is_hashable< T, typename >
 Check if std::hash and std::equal_to are defined for type T. More...
 
struct  tt::is_maplike< T, typename >
 Check if type T is like a std::map or std::unordored_map. More...
 
struct  tt::is_streamable< S, T, typename >
 Check if type T has operator<<(S, T) defined. More...
 
struct  tt::is_string_like< T, typename >
 Check if type T is a std::string, or a C-style string. More...
 
struct  tt::has_get_clone< T, typename, typename >
 Check if type T has a get_clone() member function. More...
 
struct  tt::has_clone< T, typename, typename >
 Check if type T has a clone() member function. More...
 
struct  tt::has_size< T, typename >
 Check if type T has a size() member function. More...
 
struct  tt::is_integer< I >
 Check if I is an integer type (non-bool, non-character), unlike std::is_integral. More...
 
struct  tt::remove_reference_wrapper< T >
 Gets the underlying type if the type is a std::reference_wrapper, otherwise returns the type itself. More...
 
struct  tt::remove_cvref_wrap< T >
 Removes std::reference_wrapper, references, and cv qualifiers. More...
 
struct  tt::get_fundamental_type< T, Enable >
 Extracts the fundamental type for a container. More...
 
struct  tt::is_complex_of_fundamental< T, typename >
 Determines if a type T is a std::complex of a fundamental type, is a std::true_type if so, and otherwise is a std::false_type More...
 

Namespaces

 cpp17
 C++ STL code present in C++17.
 
 cpp20
 C++ STL code present in C++20.
 
 tt
 A collection of useful type traits.
 

Macros

#define CREATE_IS_CALLABLE(METHOD_NAME)
 Generate a type trait to check if a class has a member function that can be invoked with arguments of type TArgs... More...
 

Typedefs

template<bool B>
using cpp17::bool_constant = std::integral_constant< bool, B >
 A compile-time boolean. More...
 
template<typename... Ts>
using cpp17::void_t = void
 Given a set of types, returns void More...
 
template<class T , class... Args>
using cpp17::is_constructible_t = typename std::is_constructible< T, Args... >::type
 
template<class T >
using cpp20::remove_cvref_t = typename remove_cvref< T >::type
 
template<typename F >
using tt::function_info = tt_detail::function_info_impl< F >
 Returns a struct that contains the return type, argument types, and the class type if the F is a non-static member function. More...
 
template<typename T , size_t = 0>
using tt::identity_t = T
 Given a type T and possibly a size_t evaluates to T. Useful for turning a std::index_sequence into a pack expansion of types. More...
 
template<typename Array >
using tt::array_size = decltype(TypeTraits_detail::array_size_impl(std::declval< const Array & >()))
 Get the size of a std::array as a std::integral_constant. More...
 
template<typename T >
using tt::remove_reference_wrapper_t = typename remove_reference_wrapper< T >::type
 
template<typename T >
using tt::remove_cvref_wrap_t = typename remove_cvref_wrap< T >::type
 
template<typename T >
using tt::get_fundamental_type_t = typename get_fundamental_type< T >::type
 

Variables

template<typename T , typename U >
constexpr bool cpp17::is_same_v = std::is_same<T, U>::value
 Variable template for is_same.
 
template<typename T >
constexpr bool cpp17::is_lvalue_reference_v = std::is_lvalue_reference<T>::value
 
template<typename T >
constexpr bool cpp17::is_rvalue_reference_v = std::is_rvalue_reference<T>::value
 
template<typename T >
constexpr bool cpp17::is_reference_v = std::is_reference<T>::value
 
template<class T , class... Args>
constexpr bool cpp17::is_constructible_v = std::is_constructible<T, Args...>::value
 
template<class T , class... Args>
constexpr bool cpp17::is_trivially_constructible_v
 
template<class T , class... Args>
constexpr bool cpp17::is_nothrow_constructible_v
 
template<class T >
constexpr bool cpp17::is_default_constructible_v
 
template<class T >
constexpr bool cpp17::is_trivially_default_constructible_v
 
template<class T >
constexpr bool cpp17::is_nothrow_default_constructible_v
 
template<class T >
constexpr bool cpp17::is_copy_constructible_v = std::is_copy_constructible<T>::value
 
template<class T >
constexpr bool cpp17::is_trivially_copy_constructible_v
 
template<class T >
constexpr bool cpp17::is_nothrow_copy_constructible_v
 
template<class T >
constexpr bool cpp17::is_move_constructible_v = std::is_move_constructible<T>::value
 
template<class T >
constexpr bool cpp17::is_trivially_move_constructible_v
 
template<class T >
constexpr bool cpp17::is_nothrow_move_constructible_v
 
template<class T , class U >
constexpr bool cpp17::is_assignable_v = std::is_assignable<T, U>::value
 
template<class T , class U >
constexpr bool cpp17::is_trivially_assignable_v
 
template<class T , class U >
constexpr bool cpp17::is_nothrow_assignable_v
 
template<class From , class To >
constexpr bool cpp17::is_convertible_v = std::is_convertible<From, To>::value
 
template<class T >
constexpr bool cpp17::is_copy_assignable_v = std::is_copy_assignable<T>::value
 
template<class T >
constexpr bool cpp17::is_trivially_copy_assignable_v
 
template<class T >
constexpr bool cpp17::is_nothrow_copy_assignable_v
 
template<class T >
constexpr bool cpp17::is_move_assignable_v = std::is_move_assignable<T>::value
 
template<class T >
constexpr bool cpp17::is_trivially_move_assignable_v
 
template<class T >
constexpr bool cpp17::is_nothrow_move_assignable_v
 
template<class Base , class Derived >
constexpr bool cpp17::is_base_of_v = std::is_base_of<Base, Derived>::value
 
template<class T >
constexpr bool cpp17::is_unsigned_v = std::is_unsigned<T>::value
 
template<class T >
constexpr bool cpp17::is_arithmetic_v = std::is_arithmetic<T>::value
 
template<class T >
constexpr bool cpp17::is_floating_point_v = std::is_floating_point<T>::value
 
template<class T >
constexpr bool cpp17::is_integral_v = std::is_integral<T>::value
 
template<class T >
constexpr bool cpp17::is_fundamental_v = std::is_fundamental<T>::value
 
template<typename T >
constexpr bool tt::is_complex_of_fundamental_v
 
template<typename T >
constexpr bool tt::is_complex_or_fundamental_v
 Evaluates to true if type T is a std::complex of a fundamental type or if T is a fundamental type. More...
 
template<class... B>
constexpr bool cpp17::conjunction_v = conjunction<B...>::value
 
template<class... B>
constexpr bool cpp17::disjunction_v = disjunction<B...>::value
 
template<typename T >
constexpr bool tt::can_be_copy_constructed_v = can_be_copy_constructed<T>::value
 
template<typename T >
constexpr bool tt::is_integer_v = is_integer<T>::value
 
template<typename T >
using tt::is_std_array_t = typename is_std_array< T >::type
 
template<typename T >
constexpr bool tt::is_std_array_v = is_std_array<T>::value
 
template<size_t N, typename T >
using tt::is_std_array_of_size_t = typename is_std_array_of_size< N, T >::type
 
template<size_t N, typename T >
constexpr bool tt::is_std_array_of_size_v = is_std_array_of_size<N, T>::value
 
template<template< typename... > class U, typename... Args>
using tt::is_a_t = typename is_a< U, Args... >::type
 
template<template< typename... > class U, typename... Args>
constexpr bool tt::is_a_v = is_a<U, Args...>::value
 
template<typename T >
using tt::is_iterable_t = typename is_iterable< T >::type
 
template<typename T >
constexpr bool tt::is_iterable_v = is_iterable<T>::value
 
template<typename T >
using tt::is_comparable_t = typename is_comparable< T >::type
 
template<typename T >
constexpr bool tt::is_comparable_v = is_comparable<T>::value
 
template<typename T >
using tt::has_equivalence_t = typename has_equivalence< T >::type
 
template<typename T >
constexpr bool tt::has_equivalence_v = has_equivalence<T>::value
 
template<typename T >
using tt::has_inequivalence_t = typename has_inequivalence< T >::type
 
template<typename T >
constexpr bool tt::has_inequivalence_v = has_inequivalence<T>::value
 
template<typename T , typename... Args>
using tt::is_callable_t = typename is_callable< T, Args... >::type
 
template<typename T , typename... Args>
constexpr bool tt::is_callable_v = is_callable<T, Args...>::value
 
template<typename T >
using tt::is_hashable_t = typename is_hashable< T >::type
 
template<typename T >
constexpr bool tt::is_hashable_v = is_hashable<T>::value
 
template<typename T >
using tt::is_maplike_t = typename is_maplike< T >::type
 
template<typename T >
constexpr bool tt::is_maplike_v = is_maplike<T>::value
 
template<typename S , typename T >
using tt::is_streamable_t = typename is_streamable< S, T >::type
 
template<typename S , typename T >
constexpr bool tt::is_streamable_v = is_streamable<S, T>::value
 
template<typename T >
using tt::is_string_like_t = typename is_string_like< T >::type
 
template<typename T >
constexpr bool tt::is_string_like_v = is_string_like<T>::value
 
template<typename T >
using tt::has_get_clone_t = typename has_get_clone< T >::type
 
template<typename T >
constexpr bool tt::has_get_clone_v = has_get_clone<T>::value
 
template<typename T >
using tt::has_clone_t = typename has_clone< T >::type
 
template<typename T >
constexpr bool tt::has_clone_v = has_clone<T>::value
 
template<typename T >
using tt::has_size_t = typename has_size< T >::type
 
template<typename T >
constexpr bool tt::has_size_v = has_size<T>::value
 

Detailed Description

Defines type traits, some of which are future STL type_traits header.

Features present in C++17 are in the "cpp17" namespace.