Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
Classes | Concepts | Typedefs | Functions | Variables
graphle::meta Namespace Reference

Classes

class  always_false
 
struct  is_none
 
struct  is_placeholder
 
class  is_template
 
struct  none
 
struct  placeholder
 
struct  pointed_to_as_const
 
struct  pointed_to_as_const< T * >
 
struct  pointer_constness_match
 
struct  pointer_constness_match< A *, B * >
 
struct  pointer_constness_match< A *, const B * >
 
struct  pointer_constness_match< const A *, B * >
 
struct  pointer_constness_match< const A *, const B * >
 
struct  type_list
 

Concepts

concept  of_template
 
concept  invocable_r
 
concept  list_of_types
 
concept  type_wrapper
 
concept  value_wrapper
 
concept  value_wrapper_of
 

Typedefs

template<typename T >
using pointed_to_as_const_t = typename pointed_to_as_const< T >::type
 
template<typename T >
using type = std::type_identity< T >
 
template<auto V>
using value = std::integral_constant< decltype(V), V >
 
template<typename T >
using deduce_as_t = type< T >
 
template<typename T >
using deduce_as_lvalue_t = deduce_as_t< std::remove_reference_t< T > >
 

Functions

template<bool Condition, typename T , typename F >
constexpr decltype(auto) if_constexpr (T &&if_true, F &&if_false)
 

Variables

template<typename T >
constexpr bool always_false_v = always_false<T>::value
 
template<typename A , typename B >
constexpr bool pointer_constness_match_v = pointer_constness_match<A, B>::value
 
template<typename T >
constexpr deduce_as_t< T > deduce_as = {}
 
template<typename T >
constexpr deduce_as_lvalue_t< T > deduce_as_lvalue = {}
 
template<typename T >
constexpr bool is_none_v = is_none<T>::value
 
template<typename T >
constexpr bool is_placeholder_v = is_placeholder<T>::value
 

Detailed Description

Metaprogramming utilities.

Typedef Documentation

◆ deduce_as_lvalue_t

template<typename T >
using graphle::meta::deduce_as_lvalue_t = typedef deduce_as_t<std::remove_reference_t<T> >

Equivalent to deduce_as_t but always deduces as an lvalue.

Definition at line 35 of file value.hpp.

◆ deduce_as_t

template<typename T >
using graphle::meta::deduce_as_t = typedef type<T>

Used for type deduction through member initializers.

Definition at line 30 of file value.hpp.

◆ pointed_to_as_const_t

template<typename T >
using graphle::meta::pointed_to_as_const_t = typedef typename pointed_to_as_const<T>::type

Adds const to the pointed-to type of a pointer.

Definition at line 13 of file const_pointer.hpp.

◆ type

template<typename T >
using graphle::meta::type = typedef std::type_identity<T>

A wrapper around a type.

Definition at line 10 of file value.hpp.

◆ value

template<auto V>
using graphle::meta::value = typedef std::integral_constant<decltype(V), V>

A wrapper around a NTTP.

Definition at line 12 of file value.hpp.

Function Documentation

◆ if_constexpr()

template<bool Condition, typename T , typename F >
constexpr decltype(auto) graphle::meta::if_constexpr ( T &&  if_true,
F &&  if_false 
)
inlineconstexpr

Wrapper around a constexpr-if statement to allow easily assigning different types to the same variable. E.g.:

// decltype(value) is float if UseFloatingPoint or int otherwise.
auto value = if_constexpr<UseFloatingPoint>(1.0f, 1);
std::integral_constant< decltype(V), V > value
Definition: value.hpp:12

Definition at line 15 of file if_constexpr.hpp.

Variable Documentation

◆ always_false_v

template<typename T >
constexpr bool graphle::meta::always_false_v = always_false<T>::value
inlineconstexpr

Type trait that is false for any provided type T. Prevents early evaluation in static_assert, allowing the equivalent of static_assert(false) in a constexpr-if branch.

Definition at line 20 of file concepts.hpp.

◆ deduce_as

template<typename T >
constexpr deduce_as_t<T> graphle::meta::deduce_as = {}
inlineconstexpr

Used for type deduction through member initializers.

Definition at line 32 of file value.hpp.

◆ deduce_as_lvalue

template<typename T >
constexpr deduce_as_lvalue_t<T> graphle::meta::deduce_as_lvalue = {}
inlineconstexpr

Equivalent to deduce_as_t but always deduces as an lvalue.

Definition at line 37 of file value.hpp.

◆ is_none_v

template<typename T >
constexpr bool graphle::meta::is_none_v = is_none<T>::value
inlineconstexpr

Checks if a type is meta::none

Definition at line 43 of file value.hpp.

◆ is_placeholder_v

template<typename T >
constexpr bool graphle::meta::is_placeholder_v = is_placeholder<T>::value
inlineconstexpr

Checks if a type is meta::placeholder

Definition at line 48 of file value.hpp.

◆ pointer_constness_match_v

template<typename A , typename B >
constexpr bool graphle::meta::pointer_constness_match_v = pointer_constness_match<A, B>::value
inlineconstexpr

Checks if two pointers have the same constness of their pointed-to type.

Definition at line 28 of file const_pointer.hpp.