Metaprogramming Library


The Metaprogramming library is a collection of classes and functions that assist in meta programming. This often involves dealing with types and compile-time values.


Defined in module <cmoon.meta>

Conditional Compiling


choice_t Utility for choosing different compile-time strategies
(class template)

Typing Manipulation


type_list Class for storing a list of types, similar to std::tuple, but with more functionality
(class template)
get_type Type alias for getting a type with an index into a parameter pack
(alias template)
extract_types_into_type_list Type alias for a type_list consisting of the template types that complete T
(alias template)
transform_types Type alias for a type_list<Ts...> where each T in Ts... is typename Function<T>::type
(alias template)
filter_types Type alias for a type_list<Ts2...> where Predicate<T>::value is true for each value in Ts...
(alias template)
concatenate_types Type alias for a type_list<Ts1..., Ts2..., /* ... */, TsN...> where Tsi... comes from the templates types that would complete TypeListsi
(alias template)
unique_types Type alias for a type_list<Ts2...> where Ts2... is a set of unique types from Ts...
(alias template)

Value Manipulation


value_list Class for storing a list of compile-time values as template arguments
(class template)
transform_values Type alias for typename value_list<Values...>::template transform<Function>;
(alias template)
filter_values Type alias for typename value_list<Values...>::template filter<Predicate>
(alias template)
concatenate_values Type alias for a value_list<>::template concatenate<ValueLists...>
(alias template)