GMP 0.3.0
Generative Metaprogramming library for C++
Loading...
Searching...
No Matches
Type Utilities

Type-level containers and compile-time utility primitives. More...

Concepts

concept  gmp::type_list_like
 Concept to check if a type is type_list-like.
 

Classes

struct  gmp::type_list<... >
 A variadic template structure representing a list of types. More...
 
struct  gmp::type_list_size< typename >
 Compute the number of types stored in a type list. More...
 
struct  gmp::type_list_size< type_list< Types... > >
 
struct  gmp::type_list_element< Idx, T >
 Select the type at a given index within a type list. More...
 
struct  gmp::type_list_element< Idx, type_list< Head, Types... > >
 
struct  gmp::type_list_element< 0, type_list< Head, Types... > >
 
struct  gmp::type_list_tail< T >
 Remove the first element from a type list. More...
 
struct  gmp::type_list_tail< type_list< Head, Types... > >
 
struct  gmp::type_list_concat< TypeList1, TypeList2, RestTypeLists >
 Concatenate multiple type lists into a single type list. More...
 
struct  gmp::type_list_concat< type_list< LTypes... >, type_list< RTypes... > >
 
struct  gmp::type_list_remove< Idx, T >
 Remove the type at a given index from a type list. More...
 
struct  gmp::type_list_contains< typename, type_list_like >
 Test whether a type list contains a specific type. More...
 
struct  gmp::type_list_contains< U, type_list< Types... > >
 
struct  gmp::type_list_remove< Idx, type_list< Head, Types... > >
 Public implementation of type-list element removal. More...
 
struct  gmp::type_list_remove< 0, type_list< Head, Types... > >
 
struct  gmp::type_list_insert< Idx, typename, T >
 Insert a new type at a given position in a type list. More...
 
struct  gmp::type_list_insert< Idx, NewType, type_list< Head, Types... > >
 
struct  gmp::type_list_insert< 0, NewType, type_list< Types... > >
 
struct  gmp::filter< T, typename >
 Internal placeholder used during type-list filtering machinery. More...
 
struct  gmp::type_list_reverse< type_list_like >
 Reverse the order of types in a type list. More...
 
struct  gmp::type_list_reverse< type_list< Types... > >
 
struct  gmp::type_list_reverse< type_list<> >
 
struct  gmp::type_list_unique< type_list_like >
 Remove duplicate types while preserving first occurrence order. More...
 
struct  gmp::type_list_unique< type_list< Head, Types... > >
 
struct  gmp::type_list_unique< type_list<> >
 
struct  gmp::type_list_filter< type_list_like, Pred >
 Filter a type list by a unary type predicate. More...
 
struct  gmp::type_list_filter< type_list< Head, Types... >, Pred >
 
struct  gmp::type_list_filter< type_list<>, Pred >
 
struct  gmp::constant_arg_t< auto >
 Wrap a compile-time value as a distinct function argument type. More...
 
struct  gmp::any
 A placeholder type implicitly convertible to any type. More...
 

Typedefs

template<std::size_t Idx, typename T >
using gmp::type_list_element_t = type_list_element< Idx, T >::type
 
template<type_list_like T>
using gmp::type_list_head = type_list_element_t< 0, T >
 
template<type_list_like T>
using gmp::type_list_last = type_list_element_t< type_list_size_v< T > - 1, T >
 Alias for the last element type in a type list.
 
template<typename T >
using gmp::type_list_tail_t = type_list_tail< T >::type
 
template<type_list_like... TypeLists>
using gmp::type_list_concat_t = type_list_concat< TypeLists... >::type
 
template<std::size_t Idx, type_list_like T>
using gmp::type_list_remove_t = type_list_remove< Idx, T >::type
 
template<type_list_like T>
using gmp::type_list_pop_front = type_list_remove_t< 0, T >
 
template<type_list_like T>
using gmp::type_list_pop_back = type_list_remove_t< type_list_size_v< T > - 1, T >
 
template<std::size_t Idx, typename NewType , type_list_like T>
using gmp::type_list_insert_t = type_list_insert< Idx, NewType, T >::type
 
template<typename NewType , type_list_like T>
using gmp::type_list_push_front = type_list_insert_t< 0, NewType, T >
 
template<typename NewType , type_list_like T>
using gmp::type_list_push_back = type_list_insert_t< type_list_size_v< T >, NewType, T >
 
template<type_list_like T>
using gmp::type_list_reverse_t = type_list_reverse< T >::type
 
template<typename T >
using gmp::type_list_unique_t = type_list_unique< T >::type
 
template<type_list_like T, template< typename > class Pred>
using gmp::type_list_filter_t = type_list_filter< T, Pred >::type
 

Functions

template<typename T >
consteval const T & gmp::as_value () noexcept
 Expose a default-constructed value of type T as a compile-time reference.
 

Variables

template<typename T >
constexpr std::size_t gmp::type_list_size_v
 
template<typename U , type_list_like T>
constexpr bool gmp::type_list_contains_v
 
template<auto V>
constexpr constant_arg_t< Vgmp::constant_arg
 A ready-to-use constant_arg_t<V> object for a compile-time value.
 

Detailed Description

Typedef Documentation

◆ type_list_concat_t

template<type_list_like... TypeLists>
using gmp::type_list_concat_t = typedef type_list_concat<TypeLists...>::type

Definition at line 151 of file type_list.hpp.

◆ type_list_element_t

template<std::size_t Idx, typename T >
using gmp::type_list_element_t = typedef type_list_element<Idx, T>::type

Definition at line 76 of file type_list.hpp.

◆ type_list_filter_t

template<type_list_like T, template< typename > class Pred>
using gmp::type_list_filter_t = typedef type_list_filter<T, Pred>::type

Definition at line 454 of file type_list.hpp.

◆ type_list_head

template<type_list_like T>
using gmp::type_list_head = typedef type_list_element_t<0, T>

Definition at line 100 of file type_list.hpp.

◆ type_list_insert_t

template<std::size_t Idx, typename NewType , type_list_like T>
using gmp::type_list_insert_t = typedef type_list_insert<Idx, NewType, T>::type

Definition at line 364 of file type_list.hpp.

◆ type_list_last

template<type_list_like T>
using gmp::type_list_last = typedef type_list_element_t<type_list_size_v<T> - 1, T>
Template Parameters
TA non-empty type list.

Definition at line 108 of file type_list.hpp.

◆ type_list_pop_back

template<type_list_like T>
using gmp::type_list_pop_back = typedef type_list_remove_t<type_list_size_v<T> - 1, T>

Definition at line 171 of file type_list.hpp.

◆ type_list_pop_front

template<type_list_like T>
using gmp::type_list_pop_front = typedef type_list_remove_t<0, T>

Definition at line 168 of file type_list.hpp.

◆ type_list_push_back

Definition at line 370 of file type_list.hpp.

◆ type_list_push_front

Definition at line 367 of file type_list.hpp.

◆ type_list_remove_t

template<std::size_t Idx, type_list_like T>
using gmp::type_list_remove_t = typedef type_list_remove<Idx, T>::type

Definition at line 165 of file type_list.hpp.

◆ type_list_reverse_t

template<type_list_like T>
using gmp::type_list_reverse_t = typedef type_list_reverse<T>::type

Definition at line 401 of file type_list.hpp.

◆ type_list_tail_t

Definition at line 126 of file type_list.hpp.

◆ type_list_unique_t

Definition at line 424 of file type_list.hpp.

Function Documentation

◆ as_value()

template<typename T >
consteval const T & gmp::as_value ( )
noexcept
Template Parameters
TThe type whose static compile-time value should be returned.
Returns
A reference to a long-lived default-constructed T.

Definition at line 81 of file utility.hpp.

Variable Documentation

◆ constant_arg

template<auto V>
constexpr constant_arg_t<V> gmp::constant_arg
inlineconstexpr
Template Parameters
VThe wrapped compile-time value.

Definition at line 40 of file utility.hpp.

Referenced by gmp::for_each_member(), gmp::member_name(), and gmp::member_ref().

◆ type_list_contains_v

template<typename U , type_list_like T>
constexpr bool gmp::type_list_contains_v
inlineconstexpr

Definition at line 189 of file type_list.hpp.

◆ type_list_size_v

template<typename T >
constexpr std::size_t gmp::type_list_size_v
inlineconstexpr

Definition at line 51 of file type_list.hpp.