Range-v3
Range algorithms, views, and actions for the Standard Library
meta.hpp File Reference

Tiny meta-programming library. More...

Classes

struct  meta::bind_back< F, Us >
 A Callable that partially applies the Callable F by binding the arguments Us to the back of F. More...
 
struct  meta::bind_front< F, Ts >
 A Callable that partially applies the Callable F by binding the arguments Ts to the front of F. More...
 
struct  meta::compose< Fs >
 Compose the Callables Fs in the parameter pack Ts. More...
 
struct  meta::compose< F0 >
 
struct  meta::compose< F0, Fs... >
 
struct  meta::defer< C, Ts >
 A wrapper that defers the instantiation of a template C with type parameters Ts in a lambda or let expression. More...
 
struct  meta::defer_i< T, C, Is >
 A wrapper that defers the instantiation of a template C with integral constant parameters Is in a lambda or let expression. More...
 
struct  meta::detail::count_< List, T, typename >
 
struct  meta::detail::count_< list< List... >, T >
 
struct  meta::detail::count_< list<>, T >
 
struct  meta::detail::count_if_< List, Fn, typename >
 
struct  meta::detail::count_if_< list< List... >, Fn, void_< integer_sequence< bool, bool(invoke< Fn, List >::type::value)... > > >
 
struct  meta::detail::count_if_< list<>, Fn >
 
struct  meta::extension::apply< F, List >
 A trait that unpacks the types in the type list List into the Callable F. More...
 
struct  meta::extension::apply< F, integer_sequence< T, Is... > >
 
struct  meta::extension::apply< F, Ret(Args...)>
 
struct  meta::extension::apply< F, T< Ts... > >
 
struct  meta::flip< F >
 A Callable that reverses the order of the first two arguments. More...
 
struct  meta::id< T >
 A trait that always returns its argument T. Also, a Callable that always returns T. More...
 
struct  meta::integer_sequence< T, Is >
 A container for a sequence of compile-time integer constants. More...
 
struct  meta::list< Ts >
 A list of types. More...
 
struct  meta::nil_
 An empty type. More...
 
struct  meta::quote< C >
 Turn a class template or alias template C into a Callable. More...
 
struct  meta::quote_i< T, C >
 Turn a class template or alias template C taking literals of type T into a Callable. More...
 
struct  meta::var< Tag, Value >
 For use when defining local variables in meta::let expressions. More...
 

Namespaces

 meta
 Tiny metaprogramming library.
 
 meta::extension
 Extend meta with your own datatypes.
 
 meta::lazy
 Lazy versions of meta actions.
 

Typedefs

using meta::placeholders::_args = vararg< void >
 
using meta::placeholders::_args_a = vararg< _a >
 
using meta::placeholders::_args_b = vararg< _b >
 
using meta::placeholders::_args_c = vararg< _c >
 
template<typename T >
using meta::_t = typename T::type
 Type alias for T::type.
 
template<typename T >
using meta::lazy::_t = defer< _t, T >
 
template<typename List , typename State , typename Fun >
using meta::accumulate = fold< List, State, Fun >
 An alias for meta::fold. More...
 
template<typename List , typename State , typename Fun >
using meta::lazy::accumulate = defer< accumulate, List, State, Fun >
 
template<class T >
using meta::alignof_ = meta::size_t< alignof(T)>
 An alias that computes the alignment required for any instance of the type T. More...
 
template<typename T >
using meta::lazy::alignof_ = defer< alignof_, T >
 
template<typename List , typename F >
using meta::all_of = empty< find_if< List, not_fn< F > >>
 A Boolean integral constant wrapper around true if invoke<F, A>::value is true for all elements A in meta::list List; false, otherwise. More...
 
template<typename List , typename Fn >
using meta::lazy::all_of = defer< all_of, List, Fn >
 
template<typename... Bools>
using meta::and_ = _t< defer< detail::_and_< 0==sizeof...(Bools)>::template invoke, Bools... > >
 Logically and together all the integral constant-wrapped Boolean parameters, with short-circuiting.
 
template<typename... Bools>
using meta::lazy::and_ = defer< and_, Bools... >
 
template<bool... Bools>
using meta::and_c = std::is_same< integer_sequence< bool, Bools... >, integer_sequence< bool,(Bools||true)... > >
 Logically and together all the Boolean parameters.
 
template<typename List , typename F >
using meta::any_of = not_< empty< find_if< List, F > >>
 A Boolean integral constant wrapper around true if invoke<F, A>::value is true for any element A in meta::list List; false, otherwise. More...
 
template<typename List , typename Fn >
using meta::lazy::any_of = defer< any_of, List, Fn >
 
template<typename C , typename List >
using meta::apply = _t< extension::apply< C, List > >
 Applies the Callable C using the types in the type list List as arguments.
 
template<typename F , typename List >
using meta::lazy::apply = defer< apply, F, List >
 
template<typename Sequence >
using meta::as_list = _t< detail::as_list_< Sequence > >
 Turn a type into an instance of meta::list in a way determined by meta::invoke.
 
template<typename Sequence >
using meta::lazy::as_list = defer< as_list, Sequence >
 
template<typename List , typename N >
using meta::at = _t< detail::at_< List, N > >
 Return the N th element in the meta::list List. More...
 
template<typename List , typename N >
using meta::lazy::at = defer< at, List, N >
 
template<typename List , std::size_t N>
using meta::at_c = at< List, meta::size_t< N > >
 Return the N th element in the meta::list List. More...
 
template<typename List >
using meta::back = _t< detail::back_< List > >
 Return the last element in meta::list List. More...
 
template<typename List >
using meta::lazy::back = defer< back, List >
 
template<typename Fn , typename... Ts>
using meta::lazy::bind_back = defer< bind_back, Fn, Ts... >
 
template<typename Fn , typename... Ts>
using meta::lazy::bind_front = defer< bind_front, Fn, Ts... >
 
template<typename T , typename U >
using meta::bit_and = std::integral_constant< decltype(T::type::value &U::type::value), T::type::value &U::type::value >
 An integral constant wrapper around the result of bitwise-and'ing the two wrapped integers T::type::value and U::type::value.
 
template<typename T , typename U >
using meta::lazy::bit_and = defer< bit_and, T, U >
 
template<typename T >
using meta::bit_not = std::integral_constant< decltype(~T::type::value), ~T::type::value >
 An integral constant wrapper around the result of bitwise-complementing the wrapped integer T::type::value.
 
template<typename T >
using meta::lazy::bit_not = defer< bit_not, T >
 
template<typename T , typename U >
using meta::bit_or = std::integral_constant< decltype(T::type::value|U::type::value), T::type::value|U::type::value >
 An integral constant wrapper around the result of bitwise-or'ing the two wrapped integers T::type::value and U::type::value.
 
template<typename T , typename U >
using meta::lazy::bit_or = defer< bit_or, T, U >
 
template<typename T , typename U >
using meta::bit_xor = std::integral_constant< decltype(T::type::value ^ U::type::value), T::type::value ^ U::type::value >
 An integral constant wrapper around the result of bitwise-exclusive-or'ing the two wrapped integers T::type::value and U::type::value.
 
template<typename T , typename U >
using meta::lazy::bit_xor = defer< bit_xor, T, U >
 
template<bool B>
using meta::bool_ = std::integral_constant< bool, B >
 An integral constant wrapper for bool.
 
template<typename ListOfLists >
using meta::cartesian_product = reverse_fold< ListOfLists, list< list<> >, quote_trait< detail::cartesian_product_fn > >
 Given a list of lists ListOfLists, return a new list of lists that is the Cartesian Product. Like the sequence function from the Haskell Prelude. More...
 
template<typename ListOfLists >
using meta::lazy::cartesian_product = defer< cartesian_product, ListOfLists >
 
template<char Ch>
using meta::char_ = std::integral_constant< char, Ch >
 An integral constant wrapper for char.
 
template<typename... Fns>
using meta::lazy::compose = defer< compose, Fns... >
 
template<typename... Lists>
using meta::concat = _t< detail::concat_< Lists... > >
 Concatenates several lists into a single list. More...
 
template<typename... Lists>
using meta::lazy::concat = defer< concat, Lists... >
 
template<typename List , typename T >
using meta::count = _t< detail::count_< List, T > >
 Count the number of times a type T appears in the list List. More...
 
template<typename List , typename T >
using meta::lazy::count = defer< count, List, T >
 
template<typename List , typename Fn >
using meta::count_if = _t< detail::count_if_< List, Fn > >
 Count the number of times the predicate Fn evaluates to true for all the elements in the list List. More...
 
template<typename List , typename Fn >
using meta::lazy::count_if = defer< count_if, List, Fn >
 
template<typename F , typename Q = quote<list>>
using meta::curry = compose< F, Q >
 A Callable that takes a bunch of arguments, bundles them into a type list, and then calls the Callable F with the type list Q.
 
template<typename F , typename Q = quote<list>>
using meta::lazy::curry = defer< curry, F, Q >
 
template<typename T >
using meta::dec = std::integral_constant< decltype(T::type::value - 1), T::type::value - 1 >
 An integral constant wrapper around the result of decrementing the wrapped integer T::type::value.
 
template<typename T >
using meta::lazy::dec = defer< dec, T >
 
template<template< typename... > class C, typename... Ts>
using meta::defer_trait = defer< detail::_t_t, detail::defer_< C, Ts... > >
 A wrapper that defers the instantiation of a trait C with type parameters Ts in a lambda or let expression. More...
 
template<typename T , template< T... > class C, T... Is>
using meta::defer_trait_i = defer< detail::_t_t, detail::defer_i_< T, C, Is... > >
 A wrapper that defers the instantiation of a trait C with integral constant parameters Is in a lambda or let expression. More...
 
template<typename T , typename U >
using meta::divides = std::integral_constant< decltype(T::type::value/U::type::value), T::type::value/U::type::value >
 An integral constant wrapper around the result of dividing the two wrapped integers T::type::value and U::type::value.
 
template<typename T , typename U >
using meta::lazy::divides = defer< divides, T, U >
 
template<typename List , typename N >
using meta::drop = _t< detail::drop_< List, N > >
 Return a new meta::list by removing the first N elements from List. More...
 
template<typename List , typename N >
using meta::lazy::drop = defer< drop, List, N >
 
template<typename List , std::size_t N>
using meta::drop_c = _t< detail::drop_< List, meta::size_t< N > >>
 Return a new meta::list by removing the first N elements from List. More...
 
template<typename List >
using meta::empty = bool_< 0==size< List >::type::value >
 An Boolean integral constant wrapper around true if List is an empty type list; false, otherwise. More...
 
template<typename List >
using meta::lazy::empty = defer< empty, List >
 
template<typename T , typename U >
using meta::equal_to = bool_< T::type::value==U::type::value >
 A Boolean integral constant wrapper around the result of comparing T::type::value and U::type::value for equality.
 
template<typename T , typename U >
using meta::lazy::equal_to = defer< equal_to, T, U >
 
template<typename List , typename Pred >
using meta::filter = join< transform< List, detail::filter_< Pred > >>
 Returns a new meta::list where only those elements of List that satisfy the Callable Pred such that invoke<Pred,A>::value is true are present. That is, those elements that don't satisfy the Pred are "removed". More...
 
template<typename List , typename Pred >
using meta::lazy::filter = defer< filter, List, Pred >
 
template<typename List , typename T >
using meta::find = drop< List, min< find_index< List, T >, size< List > >>
 Return the tail of the list List starting at the first occurrence of T, if any such element exists; the empty list, otherwise. More...
 
template<typename List , typename T >
using meta::lazy::find = defer< find, List, T >
 
template<typename List , typename Fun >
using meta::find_if = _t< detail::find_if_< List, Fun > >
 Return the tail of the list List starting at the first element A such that invoke<Fun, A>::value is true, if any such element exists; the empty list, otherwise. More...
 
template<typename List , typename Fun >
using meta::lazy::find_if = defer< find_if, List, Fun >
 
template<typename List , typename T >
using meta::find_index = _t< detail::find_index_< List, T > >
 Finds the index of the first occurrence of the type T within the list List. Returns meta::npos if the type T was not found. More...
 
template<typename List , typename T >
using meta::lazy::find_index = defer< find_index, List, T >
 
template<typename Pair >
using meta::first = front< Pair >
 Retrieve the first element of the pair Pair.
 
template<typename Pair >
using meta::lazy::first = defer< first, Pair >
 
template<typename F >
using meta::lazy::flip = defer< flip, F >
 
template<typename List , typename State , typename Fun >
using meta::fold = _t< detail::fold_< List, id< State >, Fun > >
 Return a new meta::list constructed by doing a left fold of the list List using binary Callable Fun and initial state State. That is, the State_N for the list element A_N is computed by Fun(State_N-1, A_N) -> State_N. More...
 
template<typename List , typename State , typename Fun >
using meta::lazy::fold = defer< fold, List, State, Fun >
 
template<typename List >
using meta::front = _t< detail::front_< List > >
 Return the first element in meta::list List. More...
 
template<typename List >
using meta::lazy::front = defer< front, List >
 
template<typename T , typename U >
using meta::greater = bool_<(T::type::value > U::type::value)>
 A Boolean integral constant wrapper around true if T::type::value is greater than U::type::value; false, otherwise.
 
template<typename T , typename U >
using meta::lazy::greater = defer< greater, T, U >
 
template<typename T , typename U >
using meta::greater_equal = bool_<(T::type::value >=U::type::value)>
 A Boolean integral constant wrapper around true if T::type::value is greater than or equal to U::type::value; false, otherwise.
 
template<typename T , typename U >
using meta::lazy::greater_equal = defer< greater_equal, T, U >
 
template<typename T >
using meta::lazy::id = defer< id, T >
 
template<typename T >
using meta::id_t = _t< id< T > >
 An alias for type T. Useful in non-deduced contexts.
 
template<typename... Args>
using meta::if_ = _t< detail::_if_< list< Args... > >>
 Select one type or another depending on a compile-time Boolean.
 
template<typename... Args>
using meta::lazy::if_ = defer< if_, Args... >
 
template<bool If, typename... Args>
using meta::if_c = _t< detail::_if_< list< bool_< If >, Args... > >>
 Select one type or another depending on a compile-time Boolean.
 
template<bool If, typename... Args>
using meta::lazy::if_c = if_< bool_< If >, Args... >
 
template<typename List , typename T >
using meta::in = not_< empty< find< List, T > >>
 A Boolean integral constant wrapper around true if there is at least one occurrence of T in List. More...
 
template<typename List , typename T >
using meta::lazy::in = defer< in, List, T >
 
template<typename T >
using meta::inc = std::integral_constant< decltype(T::type::value+1), T::type::value+1 >
 An integral constant wrapper around the result of incrementing the wrapped integer T::type::value.
 
template<typename T >
using meta::lazy::inc = defer< inc, T >
 
template<std::size_t... Is>
using meta::index_sequence = integer_sequence< std::size_t, Is... >
 A container for a sequence of compile-time integer constants of type std::size_t.
 
template<typename List >
using meta::inherit = meta::_t< detail::inherit_< List > >
 A type that inherits from all the types in the list. More...
 
template<typename List >
using meta::lazy::inherit = defer< inherit, List >
 
template<int I>
using meta::int_ = std::integral_constant< int, I >
 An integral constant wrapper for int.
 
template<class T , T From, T To>
using meta::integer_range = _t< detail::coerce_indices_< T, From, make_index_sequence< detail::range_distance_(From, To)> >>
 Makes the integer sequence [From, To). More...
 
template<typename F , typename... Args>
using meta::invoke = typename F::template invoke< Args... >
 Evaluate the Callable F with the arguments Args.
 
template<typename F , typename... Args>
using meta::lazy::invoke = defer< invoke, F, Args... >
 
template<typename T , template< typename... > class C>
using meta::is = _t< detail::is_< T, C > >
 is More...
 
template<typename T >
using meta::is_callable = _t< detail::is_callable_< T > >
 An alias for std::true_type if T::invoke exists and names a class template or alias template; otherwise, it's an alias for std::false_type.
 
template<typename T >
using meta::is_trait = _t< detail::is_trait_< T > >
 An alias for std::true_type if T::type exists and names a type; otherwise, it's an alias for std::false_type.
 
template<typename T >
using meta::is_valid = detail::is_valid_< T >
 For testing whether a deferred computation will succeed in a let or a lambda.
 
template<typename ListOfLists >
using meta::join = apply< quote< concat >, ListOfLists >
 Joins a list of lists into a single list. More...
 
template<typename ListOfLists >
using meta::lazy::join = defer< join, ListOfLists >
 
template<typename... Ts>
using meta::lambda = if_c<(sizeof...(Ts) > 0), detail::lambda_< list< Ts... > >>
 For creating anonymous Callables. More...
 
template<typename T , typename U >
using meta::less = bool_<(T::type::value< U::type::value)>
 A Boolean integral constant wrapper around true if T::type::value is less than U::type::value; false, otherwise.
 
template<typename T , typename U >
using meta::lazy::less = defer< less, T, U >
 
template<typename T , typename U >
using meta::less_equal = bool_<(T::type::value<=U::type::value)>
 A Boolean integral constant wrapper around true if T::type::value is less than or equal to U::type::value; false, otherwise.
 
template<typename T , typename U >
using meta::lazy::less_equal = defer< less_equal, T, U >
 
template<typename... As>
using meta::let = _t< _t< detail::let_< As... > >>
 A lexically scoped expression with local variables. More...
 
template<typename... As>
using meta::lazy::let = defer< let, As... >
 
template<std::size_t N>
using meta::make_index_sequence = _t< detail::make_indices_< N, index_sequence< 0 >, detail::strategy_(1, N)> >
 Generate index_sequence containing integer constants [0,1,2,...,N-1]. More...
 
template<typename T , T N>
using meta::make_integer_sequence = _t< detail::coerce_indices_< T, 0, make_index_sequence< static_cast< std::size_t >(N)> >>
 Generate integer_sequence containing integer constants [0,1,2,...,N-1]. More...
 
template<typename... Ts>
using meta::max = fold< pop_front< list< Ts... > >, front< list< Ts... > >, quote< detail::max_ > >
 An integral constant wrapper around the maximum of Ts::type::value...
 
template<typename... Ts>
using meta::lazy::max = defer< max, Ts... >
 
template<typename... Ts>
using meta::min = fold< pop_front< list< Ts... > >, front< list< Ts... > >, quote< detail::min_ > >
 An integral constant wrapper around the minimum of Ts::type::value...
 
template<typename... Ts>
using meta::lazy::min = defer< min, Ts... >
 
template<typename T , typename U >
using meta::minus = std::integral_constant< decltype(T::type::value - U::type::value), T::type::value - U::type::value >
 An integral constant wrapper around the result of subtracting the two wrapped integers T::type::value and U::type::value.
 
template<typename T , typename U >
using meta::lazy::minus = defer< minus, T, U >
 
template<typename T , typename U >
using meta::modulus = std::integral_constant< decltype(T::type::value % U::type::value), T::type::value % U::type::value >
 An integral constant wrapper around the remainder of dividing the two wrapped integers T::type::value and U::type::value.
 
template<typename T , typename U >
using meta::lazy::modulus = defer< modulus, T, U >
 
template<typename T , typename U >
using meta::multiplies = std::integral_constant< decltype(T::type::value *U::type::value), T::type::value *U::type::value >
 An integral constant wrapper around the result of multiplying the two wrapped integers T::type::value and U::type::value.
 
template<typename T , typename U >
using meta::lazy::multiplies = defer< multiplies, T, U >
 
template<typename T >
using meta::negate = std::integral_constant< decltype(-T::type::value), -T::type::value >
 An integral constant wrapper around the result of negating the wrapped integer T::type::value.
 
template<typename T >
using meta::lazy::negate = defer< negate, T >
 
template<typename List , typename F >
using meta::none_of = empty< find_if< List, F > >
 A Boolean integral constant wrapper around true if invoke<F, A>::value is false for all elements A in meta::list List; false, otherwise. More...
 
template<typename List , typename Fn >
using meta::lazy::none_of = defer< none_of, List, Fn >
 
template<typename Bool_ >
using meta::not_ = not_c< Bool_::type::value >
 Logically negate the integral constant-wrapped Boolean parameter.
 
template<typename Bool_ >
using meta::lazy::not_ = defer< not_, Bool_ >
 
template<bool Bool_>
using meta::not_c = bool_<!Bool_ >
 Logically negate the Boolean parameter.
 
template<typename T , typename U >
using meta::not_equal_to = bool_< T::type::value !=U::type::value >
 A Boolean integral constant wrapper around the result of comparing T::type::value and U::type::value for inequality.
 
template<typename T , typename U >
using meta::lazy::not_equal_to = defer< not_equal_to, T, U >
 
template<typename F >
using meta::not_fn = compose< quote< not_ >, F >
 Logically negate the result of Callable F.
 
template<typename F >
using meta::lazy::not_fn = defer< not_fn, F >
 
using meta::npos = meta::size_t< std::size_t(-1)>
 A special value used to indicate no matches. It equals the maximum value representable by std::size_t.
 
template<typename... Fs>
using meta::on = detail::on_< Fs... >
 Use as on<F, Gs...>. Creates an Callable that applies Callable F to the result of applying Callable compose<Gs...> to all the arguments.
 
template<typename F , typename G >
using meta::lazy::on = defer< on, F, G >
 
template<typename... Bools>
using meta::or_ = _t< defer< detail::_or_< 0==sizeof...(Bools)>::template invoke, Bools... > >
 Logically or together all the integral constant-wrapped Boolean parameters, with short-circuiting.
 
template<typename... Bools>
using meta::lazy::or_ = defer< or_, Bools... >
 
template<bool... Bools>
using meta::or_c = not_< std::is_same< integer_sequence< bool, Bools... >, integer_sequence< bool,(Bools &&false)... > >>
 Logically or together all the Boolean parameters.
 
template<typename F , typename S >
using meta::pair = list< F, S >
 A list with exactly two elements.
 
template<typename List , typename Pred >
using meta::partition = fold< List, pair< list<>, list<> >, detail::partition_< Pred > >
 Returns a pair of lists, where the elements of List that satisfy the Callable Pred such that invoke<Pred,A>::value is true are present in the first list and the rest are in the second. More...
 
template<typename List , typename Pred >
using meta::lazy::partition = defer< partition, List, Pred >
 
template<typename T , typename U >
using meta::plus = std::integral_constant< decltype(T::type::value+U::type::value), T::type::value+U::type::value >
 An integral constant wrapper around the result of adding the two wrapped integers T::type::value and U::type::value.
 
template<typename T , typename U >
using meta::lazy::plus = defer< plus, T, U >
 
template<typename List >
using meta::pop_front = _t< detail::pop_front_< List > >
 Return a new meta::list by removing the first element from the front of List. More...
 
template<typename List >
using meta::lazy::pop_front = defer< pop_front, List >
 
template<typename T >
using meta::protect = detail::protect_< T >
 For preventing the evaluation of a nested defered computation in a let or lambda expression.
 
template<typename List , typename T >
using meta::push_back = _t< detail::push_back_< List, T > >
 Return a new meta::list by adding the element T to the back of List. More...
 
template<typename List , typename T >
using meta::lazy::push_back = defer< push_back, List, T >
 
template<typename List , typename T >
using meta::push_front = _t< detail::push_front_< List, T > >
 Return a new meta::list by adding the element T to the front of List. More...
 
template<typename List , typename T >
using meta::lazy::push_front = defer< push_front, List, T >
 
template<template< typename... > class C>
using meta::quote_trait = compose< quote< _t >, quote< C > >
 Turn a trait template C into a Callable. More...
 
template<typename T , template< T... > class C>
using meta::quote_trait_i = compose< quote< _t >, quote_i< T, C > >
 Turn a trait C taking literals of type T into a Callable. More...
 
template<typename N , typename T = void>
using meta::repeat_n = repeat_n_c< N::type::value, T >
 Generate list<T,T,T...T> of size N arguments. More...
 
template<typename N , typename T = void>
using meta::lazy::repeat_n = defer< repeat_n, N, T >
 
template<std::size_t N, typename T = void>
using meta::repeat_n_c = _t< detail::repeat_n_c_< T, make_index_sequence< N > >>
 Generate list<T,T,T...T> of size N arguments. More...
 
template<std::size_t N, typename T = void>
using meta::lazy::repeat_n_c = defer< repeat_n, meta::size_t< N >, T >
 
template<typename List , typename T , typename U >
using meta::replace = _t< detail::replace_< List, T, U > >
 Return a new meta::list where all instances of type T have been replaced with U. More...
 
template<typename List , typename T , typename U >
using meta::lazy::replace = defer< replace, T, U >
 
template<typename List , typename C , typename U >
using meta::replace_if = _t< detail::replace_if_< List, C, U > >
 Return a new meta::list where all elements A of the list List for which invoke<C,A>::value is true have been replaced with U. More...
 
template<typename List , typename C , typename U >
using meta::lazy::replace_if = defer< replace_if, C, U >
 
template<typename List >
using meta::reverse = _t< detail::reverse_< List > >
 Return a new meta::list by reversing the elements in the list List. More...
 
template<typename List >
using meta::lazy::reverse = defer< reverse, List >
 
template<typename List , typename T >
using meta::reverse_find = drop< List, min< reverse_find_index< List, T >, size< List > >>
 Return the tail of the list List starting at the last occurrence of T, if any such element exists; the empty list, otherwise. More...
 
template<typename List , typename T >
using meta::lazy::reverse_find = defer< reverse_find, List, T >
 
template<typename List , typename Fun >
using meta::reverse_find_if = _t< detail::reverse_find_if_< List, Fun > >
 Return the tail of the list List starting at the last element A such that invoke<Fun, A>::value is true, if any such element exists; the empty list, otherwise. More...
 
template<typename List , typename Fun >
using meta::lazy::reverse_find_if = defer< reverse_find_if, List, Fun >
 
template<typename List , typename T >
using meta::reverse_find_index = _t< detail::reverse_find_index_< List, T > >
 Finds the index of the last occurrence of the type T within the list List. Returns meta::npos if the type T was not found. More...
 
template<typename List , typename T >
using meta::lazy::reverse_find_index = defer< reverse_find_index, List, T >
 
template<typename List , typename State , typename Fun >
using meta::reverse_fold = _t< detail::reverse_fold_< List, State, Fun > >
 Return a new meta::list constructed by doing a right fold of the list List using binary Callable Fun and initial state State. That is, the State_N for the list element A_N is computed by Fun(A_N, State_N+1) -> State_N. More...
 
template<typename List , typename State , typename Fun >
using meta::lazy::reverse_fold = defer< reverse_fold, List, State, Fun >
 
template<typename Pair >
using meta::second = front< pop_front< Pair > >
 Retrieve the first element of the pair Pair.
 
template<typename Pair >
using meta::lazy::second = defer< second, Pair >
 
template<typename List >
using meta::size = meta::size_t< List::size()>
 An integral constant wrapper that is the size of the meta::list List.
 
template<typename List >
using meta::lazy::size = defer< size, List >
 
template<std::size_t N>
using meta::size_t = std::integral_constant< std::size_t, N >
 An integral constant wrapper for std::size_t.
 
template<class T >
using meta::sizeof_ = meta::size_t< sizeof(T)>
 An alias that computes the size of the type T. More...
 
template<typename T >
using meta::lazy::sizeof_ = defer< sizeof_, T >
 
template<typename List , typename Pred >
using meta::sort = _t< detail::sort_< List, Pred > >
 Return a new meta::list that is sorted according to Callable predicate Pred. More...
 
template<typename List , typename Pred >
using meta::lazy::sort = defer< sort, List, Pred >
 
template<typename... Bools>
using meta::strict_and = and_c< Bools::type::value... >
 Logically and together all the integral constant-wrapped Boolean parameters, without doing short-circuiting.
 
template<typename... Bools>
using meta::lazy::strict_and = defer< strict_and, Bools... >
 
template<typename... Bools>
using meta::strict_or = or_c< Bools::type::value... >
 Logically or together all the integral constant-wrapped Boolean parameters, without doing short-circuiting.
 
template<typename... Bools>
using meta::lazy::strict_or = defer< strict_or, Bools... >
 
template<typename... Args>
using meta::transform = _t< detail::transform_< list< Args... > >>
 Return a new meta::list constructed by transforming all the elements in List with the unary Callable Fun. transform can also be called with two lists of the same length and a binary Callable, in which case it returns a new list constructed with the results of calling Fun with each element in the lists, pairwise. More...
 
template<typename... Args>
using meta::lazy::transform = defer< transform, Args... >
 
template<typename ListOfLists >
using meta::transpose = fold< ListOfLists, repeat_n< size< front< ListOfLists > >, list<> >, bind_back< quote< transform >, quote< push_back > >>
 Given a list of lists of types ListOfLists, transpose the elements from the lists. More...
 
template<typename ListOfLists >
using meta::lazy::transpose = defer< transpose, ListOfLists >
 
template<typename F >
using meta::uncurry = bind_front< quote< apply >, F >
 A Callable that takes a type list, unpacks the types, and then calls the Callable F with the types.
 
template<typename F >
using meta::lazy::uncurry = defer< uncurry, F >
 
template<typename List >
using meta::unique = fold< List, list<>, quote_trait< detail::insert_back_ > >
 Return a new meta::list where all duplicate elements have been removed. More...
 
template<typename List >
using meta::lazy::unique = defer< unique, List >
 
template<typename T >
using meta::vararg = detail::vararg_< T >
 For defining variadic placeholders.
 
template<typename... >
using meta::void_ = void
 An alias for void.
 
template<typename ListOfLists >
using meta::zip = transpose< ListOfLists >
 Given a list of lists of types ListOfLists, construct a new list by grouping the elements from the lists pairwise into meta::lists. More...
 
template<typename ListOfLists >
using meta::lazy::zip = defer< zip, ListOfLists >
 
template<typename Fun , typename ListOfLists >
using meta::zip_with = transform< transpose< ListOfLists >, uncurry< Fun > >
 Given a list of lists of types ListOfLists and a Callable Fun, construct a new list by calling Fun with the elements from the lists pairwise. More...
 
template<typename Fun , typename ListOfLists >
using meta::lazy::zip_with = defer< zip_with, Fun, ListOfLists >
 

Functions

template<typename T >
constexpr T * meta::detail::_nullptr_v ()
 Returns a T nullptr.
 
constexpr std::size_t meta::detail::count_i_ (bool const *const begin, bool const *const end, std::size_t n)
 
template<char... Chs>
constexpr fold< list< char_< Chs >... >, meta::size_t< 0 >, quote< detail::atoi_ > > meta::literals::operator"" _z ()
 A user-defined literal that generates objects of type meta::size_t.
 

Variables

constexpr auto && meta::for_each = detail::static_const<detail::for_each_fn>::value
 for_each(List, UnaryFunction) calls the UnaryFunction for each argument in the List.
 

Detailed Description

Tiny meta-programming library.