GMP 0.3.0
Generative Metaprogramming library for C++
Loading...
Searching...
No Matches
gmp Namespace Reference

Namespaces

namespace  dp
 

Classes

struct  any
 A placeholder type implicitly convertible to any type. More...
 
struct  constant_arg_t
 Wrap a compile-time value as a distinct function argument type. More...
 
struct  enum_traits
 Customize the reflection range or explicit values for an enumeration. More...
 
struct  filter
 Internal placeholder used during type-list filtering machinery. More...
 
struct  fixed_string
 A compile-time string type with fixed length and constexpr operations. More...
 
class  object_factory
 A singleton-backed runtime factory that creates products by string key. More...
 
struct  pretty_type_name
 Format a type name for documentation-friendly display. More...
 
struct  pretty_type_name< std::array< T, N > >
 Formatter specialization for std::array<T, N>. More...
 
struct  pretty_type_name< std::string >
 Formatter specialization for std::string. More...
 
struct  pretty_type_name< std::string_view >
 Formatter specialization for std::string_view. More...
 
struct  pretty_type_name< std::vector< T > >
 Formatter specialization for std::vector<T>. More...
 
class  singleton
 CRTP-based singleton helper with optional dead-reference recovery. More...
 
class  singleton< T, false >
 Default singleton specialization using a function-local static object. More...
 
class  singleton< T, true >
 Singleton specialization with dead-reference recovery support. More...
 
struct  type_list
 A variadic template structure representing a list of types. More...
 
struct  type_list_concat
 Concatenate multiple type lists into a single type list. More...
 
struct  type_list_concat< type_list< LTypes... >, type_list< RTypes... > >
 
struct  type_list_contains
 Test whether a type list contains a specific type. More...
 
struct  type_list_contains< U, type_list< Types... > >
 
struct  type_list_element
 Select the type at a given index within a type list. More...
 
struct  type_list_element< 0, type_list< Head, Types... > >
 
struct  type_list_element< Idx, type_list< Head, Types... > >
 
struct  type_list_filter
 Filter a type list by a unary type predicate. More...
 
struct  type_list_filter< type_list< Head, Types... >, Pred >
 
struct  type_list_filter< type_list<>, Pred >
 
struct  type_list_insert
 Insert a new type at a given position in a type list. More...
 
struct  type_list_insert< 0, NewType, type_list< Types... > >
 
struct  type_list_insert< Idx, NewType, type_list< Head, Types... > >
 
struct  type_list_remove
 Remove the type at a given index from a type list. More...
 
struct  type_list_remove< 0, type_list< Head, Types... > >
 
struct  type_list_remove< Idx, type_list< Head, Types... > >
 Public implementation of type-list element removal. More...
 
struct  type_list_reverse
 Reverse the order of types in a type list. More...
 
struct  type_list_reverse< type_list< Types... > >
 
struct  type_list_reverse< type_list<> >
 
struct  type_list_size
 Compute the number of types stored in a type list. More...
 
struct  type_list_size< type_list< Types... > >
 
struct  type_list_tail
 Remove the first element from a type list. More...
 
struct  type_list_tail< type_list< Head, Types... > >
 
struct  type_list_unique
 Remove duplicate types while preserving first occurrence order. More...
 
struct  type_list_unique< type_list< Head, Types... > >
 
struct  type_list_unique< type_list<> >
 

Concepts

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

Typedefs

template<std::size_t I, typename T >
using member_type_t = std::remove_cvref_t< decltype(*detail::field_getter< I, T >(constant_arg< member_count< T >()>))>
 Alias for the type of the I-th member of an aggregate type.
 
template<std::size_t Idx, typename T >
using type_list_element_t = type_list_element< Idx, T >::type
 
template<type_list_like T>
using type_list_head = type_list_element_t< 0, T >
 
template<type_list_like T>
using 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 type_list_tail_t = type_list_tail< T >::type
 
template<type_list_like... TypeLists>
using type_list_concat_t = type_list_concat< TypeLists... >::type
 
template<std::size_t Idx, type_list_like T>
using type_list_remove_t = type_list_remove< Idx, T >::type
 
template<type_list_like T>
using type_list_pop_front = type_list_remove_t< 0, T >
 
template<type_list_like T>
using 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 type_list_insert_t = type_list_insert< Idx, NewType, T >::type
 
template<typename NewType , type_list_like T>
using type_list_push_front = type_list_insert_t< 0, NewType, T >
 
template<typename NewType , type_list_like T>
using type_list_push_back = type_list_insert_t< type_list_size_v< T >, NewType, T >
 
template<type_list_like T>
using type_list_reverse_t = type_list_reverse< T >::type
 
template<typename T >
using type_list_unique_t = type_list_unique< T >::type
 
template<type_list_like T, template< typename > class Pred>
using type_list_filter_t = type_list_filter< T, Pred >::type
 

Functions

template<std::size_t N>
 fixed_string (char const(&)[N]) -> fixed_string< N - 1 >
 Deduce fixed_string length from a string literal.
 
template<std::size_t N1, std::size_t N2>
consteval fixed_string< N1+N2operator+ (fixed_string< N1 > const &s1, fixed_string< N2 > const &s2)
 Concatenate two fixed strings at compile time.
 
template<fixed_string FirstValue, fixed_string... RestValues, auto String>
consteval auto remove_all (constant_arg_t< String >)
 Remove all occurrences of one or more compile-time substrings.
 
template<typename E , fixed_string P = type_name<E>() + fixed_string("::")>
consteval auto enum_values ()
 Get all enumerator values of an enumeration type at compile-time.
 
template<typename E , fixed_string P = type_name<E>() + fixed_string("::")>
consteval auto enum_count ()
 Count the number of enumerators in an enumeration type at compile-time.
 
template<auto E, fixed_string P = fixed_string("::")>
consteval auto enum_name ()
 Get the name of an enumerator at compile-time.
 
template<typename E >
consteval auto enum_names ()
 Get all enumerator names of an enumeration type at compile-time.
 
template<typename E >
consteval auto enum_entries ()
 Get all enumerator entries (value, name) of an enumeration type at compile-time.
 
template<typename E >
constexpr auto enum_index (E value) -> std::optional< std::size_t >
 Get the index of an enumerator value in enum_values<E>().
 
template<typename E >
constexpr auto enum_cast (std::string_view name) -> std::optional< E >
 Cast an enumerator name to its corresponding enumerator value.
 
template<typename T , typename... Args>
requires std::is_aggregate_v<std::remove_cvref_t<T>>
consteval int member_count ()
 Count the number of members in an aggregate type at compile-time.
 
template<std::size_t I, typename T >
requires std::is_aggregate_v<T> && (I < member_count<T>()) && (member_count<T>() <= GMP_MAX_SUPPORTED_FIELDS)
consteval auto member_name () noexcept
 Get the name of a specific member of an aggregate type at compile-time.
 
template<typename T >
consteval auto member_names ()
 Get all member names of an aggregate type at compile-time.
 
template<typename T >
constexpr auto member_type_names ()
 Returns an array of string_view containing the type names of all members of aggregate type T.
 
template<std::size_t I, typename T , typename UnqualifiedT = std::remove_cvref_t<T>>
requires std::is_aggregate_v<UnqualifiedT> && (I < member_count<UnqualifiedT>()) && (member_count<UnqualifiedT>() <= GMP_MAX_SUPPORTED_FIELDS)
decltype(automember_ref (T &&value) noexcept
 Get a reference to the I-th member of an aggregate object.
 
template<typename T , typename F >
requires std::is_aggregate_v<std::remove_cvref_t<T>>
void for_each_member (T &&value, F &&func) noexcept
 Visit each member of an aggregate object together with its member name.
 
template<typename Func >
constexpr auto make_named_operator (Func &&f)
 Create a token that lets a callable be used as a named infix operator.
 
constexpr bool is_equal (const char *lhs, const char *rhs) noexcept
 
template<typename T >
consteval auto type_name ()
 Get the string representation of a type at compile-time.
 
template<typename T >
consteval std::size_t type_size ()
 Calculate the actual payload size of a type without aggregate padding.
 
template<typename T >
consteval const T & as_value () noexcept
 Expose a default-constructed value of type T as a compile-time reference.
 

Variables

template<typename E >
constexpr int enum_min_v
 The minimum reflection scan value for enumeration type E.
 
template<typename E >
constexpr int enum_max_v
 The maximum reflection scan value for enumeration type E.
 
template<std::intmax_t N>
static constexpr auto to_fixed_string_v
 
template<typename T >
constexpr std::size_t type_list_size_v
 
template<typename U , type_list_like T>
constexpr bool type_list_contains_v
 
template<auto V>
constexpr constant_arg_t< Vconstant_arg
 A ready-to-use constant_arg_t<V> object for a compile-time value.