template metaprogramming metafunctions on tuple types More...
Data Structures | |
struct | RepeatType |
Functions | |
template<typename Tuple , template< typename...> class TemplateFunction> | |
constexpr auto | unpackToFunction () |
template<typename TupleType , template< typename > class TemplateFunction> | |
constexpr auto | map () |
template<typename TupleType , typename T > | |
constexpr unsigned | countType () |
Counts how often a type is contained in a tuple type. | |
template<typename TupleType , template< typename > class UnaryPredicate> | |
constexpr bool | allOf () |
all_of with tuple types and template metafunctions More... | |
template<typename TupleType , template< typename...> class TemplateFunction> | |
constexpr auto | mapAllPairs () |
Map all pairs of types in a tuple typedefs into a template function. More... | |
template metaprogramming metafunctions on tuple types
constexpr bool Scine::Molassembler::Temple::Tuples::allOf | ( | ) |
all_of with tuple types and template metafunctions
Tests whether all types in the tuple return true when evaluated against a predicate
Complexity \(O(N)\)
constexpr auto Scine::Molassembler::Temple::Tuples::map | ( | ) |
Takes a tuple type and a template function that accepts a single type at a time and returns an array of the return values of the template function called with the tuple types.
constexpr auto Scine::Molassembler::Temple::Tuples::mapAllPairs | ( | ) |
Map all pairs of types in a tuple typedefs into a template function.
Takes a tuple type and a template function that accepts pairs of the tuple's contained types. Returns an array containing the result of the mapping for all distinct possible type pairs.
With distinct, we mean that pairs of the same types are not created unless a type is explicitly repeated in the tuple type: Say the tuple contains Apple, Banana and Orange, then the generated pairs are: Apple & Banana, Apple & Orange and Banana & Orange.
Complexity \(\Theta(N^2)\)
TupleType | tuple typedef containing the types whose pairs should be mapped |
TemplateFunction | template metafunction with a static constexpr value member or member function |
constexpr auto Scine::Molassembler::Temple::Tuples::unpackToFunction | ( | ) |
Takes a tuple type and a template function that accepts all of the tuple's contained types at once and unpacks these as template parameters to the template function, returning it's value.