Empirical
|
#include <TypePack.h>
Public Types | |
template<int POS> | |
using | get = pack_id< POS, T1, Ts... > |
Get the type associated with a specified position in the pack. More... | |
using | this_t = TypePack< T1, Ts... > |
What is the full type of this TypePack? More... | |
using | first_t = T1 |
What is the first type in this TypePack? More... | |
using | last_t = last_type< T1, Ts... > |
What is the final type in this TypePack? More... | |
template<typename... T> | |
using | push_front = TypePack< T..., T1, Ts... > |
Push a new type onto the front of this TypePack. More... | |
template<typename... T> | |
using | push_back = TypePack< T1, Ts..., T... > |
Push a new type onto the back of this TypePack. More... | |
template<typename... T> | |
using | add = TypePack< T1, Ts..., T... > |
Push a new type onto the back of this TypePack. More... | |
using | pop = TypePack< Ts... > |
Remove the first type from this TypePack and return the rest. More... | |
template<int N> | |
using | popN = typename tp_shift< N, TypePack<>, this_t >::type2 |
template<int N> | |
using | shrink = typename tp_shift< N, TypePack<>, this_t >::type1 |
Reduce the size of this TypePack down to N. More... | |
template<typename T , int N = 1> | |
using | pad = typename tp_pad< this_t, T, N >::type |
Add N new entries onto TypePack, all of provided type T. More... | |
template<int N, typename DEFAULT = null_t> | |
using | resize = typename pad< DEFAULT,(N >SIZE)?(N-SIZE):0 >::template shrink< N > |
Make this TypePack the specified size, padding with provided type T. More... | |
template<typename IN > | |
using | merge = typename tp_shift< IN::SIZE, this_t, IN >::type1 |
Join this TypePack with another TypePack. More... | |
using | reverse = typename pop::reverse::template push_back< T1 > |
Rearrange types in TypePack into reverse order. More... | |
using | rotate = typename pop::template push_back< T1 > |
Rotate types through typepack by the specified number of steps. More... | |
template<int ID, typename T > | |
using | set = typename shrink< ID >::template push_back< T >::template merge< popN< ID+1 >> |
Set the type at the specified position to the new type provided. Return as new TypePack. More... | |
template<int... Ps> | |
using | select = TypePack< get< Ps >... > |
Choose a set of specific positions. Return as new TypePack. More... | |
template<typename RETURN_T > | |
using | to_function_t = RETURN_T(T1, Ts...) |
Convert to a function signature with a specified return type. More... | |
template<template< typename... > class TEMPLATE> | |
using | apply = TEMPLATE< T1, Ts... > |
Apply to a specified template with TypePack as template arguments. More... | |
template<template< typename... > class FILTER> | |
using | filter = tp_filter_t< this_t, FILTER > |
Remove all types that cannot pass a filter. Return as new TypePack. More... | |
template<template< typename... > class FILTER> | |
using | find_t = typename tp_filter_t< this_t, FILTER >::first_t |
Return the first type that satisfies a filter. More... | |
template<template< typename... > class WRAPPER> | |
using | wrap = tp_wrap_t< this_t, WRAPPER > |
Wrap all types in a specified wrapper template. More... | |
Static Public Member Functions | |
template<typename T > | |
static constexpr bool | Has () |
Return a bool indicating whether the specified type is present. More... | |
template<typename T > | |
static constexpr size_t | Count () |
Count the number of instances of the specified type. More... | |
template<typename T > | |
static constexpr int | GetID () |
Return the position of the specified type. More... | |
template<typename T > | |
static constexpr int | GetID (const T &) |
Return the position of the type of owner. More... | |
static constexpr int | GetSize () |
Return the number of types in this pack. More... | |
static constexpr bool | IsEmpty () |
Return bool indicating if there are any types in this pack. More... | |
static constexpr bool | IsUnique () |
Return bool indicating if all types in this pack are different from each other. More... | |
Static Public Attributes | |
static constexpr int | SIZE = 1+sizeof...(Ts) |
Set to the number of types in this pack. More... | |
using emp::TypePack< T1, Ts... >::add = TypePack<T1,Ts...,T...> |
Push a new type onto the back of this TypePack.
using emp::TypePack< T1, Ts... >::apply = TEMPLATE<T1, Ts...> |
Apply to a specified template with TypePack as template arguments.
using emp::TypePack< T1, Ts... >::filter = tp_filter_t<this_t, FILTER> |
Remove all types that cannot pass a filter. Return as new TypePack.
using emp::TypePack< T1, Ts... >::find_t = typename tp_filter_t<this_t, FILTER>::first_t |
Return the first type that satisfies a filter.
using emp::TypePack< T1, Ts... >::first_t = T1 |
What is the first type in this TypePack?
using emp::TypePack< T1, Ts... >::get = pack_id<POS, T1, Ts...> |
Get the type associated with a specified position in the pack.
using emp::TypePack< T1, Ts... >::last_t = last_type<T1,Ts...> |
What is the final type in this TypePack?
using emp::TypePack< T1, Ts... >::merge = typename tp_shift<IN::SIZE, this_t, IN>::type1 |
using emp::TypePack< T1, Ts... >::pad = typename tp_pad<this_t,T,N>::type |
Add N new entries onto TypePack, all of provided type T.
using emp::TypePack< T1, Ts... >::pop = TypePack<Ts...> |
Remove the first type from this TypePack and return the rest.
using emp::TypePack< T1, Ts... >::popN = typename tp_shift<N, TypePack<>, this_t>::type2 |
using emp::TypePack< T1, Ts... >::push_back = TypePack<T1,Ts...,T...> |
Push a new type onto the back of this TypePack.
using emp::TypePack< T1, Ts... >::push_front = TypePack<T...,T1,Ts...> |
Push a new type onto the front of this TypePack.
using emp::TypePack< T1, Ts... >::resize = typename pad<DEFAULT,(N>SIZE)?(N-SIZE):0>::template shrink<N> |
Make this TypePack the specified size, padding with provided type T.
using emp::TypePack< T1, Ts... >::reverse = typename pop::reverse::template push_back<T1> |
Rearrange types in TypePack into reverse order.
using emp::TypePack< T1, Ts... >::rotate = typename pop::template push_back<T1> |
Rotate types through typepack by the specified number of steps.
using emp::TypePack< T1, Ts... >::select = TypePack< get<Ps>... > |
Choose a set of specific positions. Return as new TypePack.
using emp::TypePack< T1, Ts... >::set = typename shrink<ID>::template push_back<T>::template merge<popN<ID+1>> |
Set the type at the specified position to the new type provided. Return as new TypePack.
using emp::TypePack< T1, Ts... >::shrink = typename tp_shift<N, TypePack<>, this_t>::type1 |
Reduce the size of this TypePack down to N.
using emp::TypePack< T1, Ts... >::this_t = TypePack<T1, Ts...> |
What is the full type of this TypePack?
using emp::TypePack< T1, Ts... >::to_function_t = RETURN_T(T1,Ts...) |
Convert to a function signature with a specified return type.
using emp::TypePack< T1, Ts... >::wrap = tp_wrap_t<this_t, WRAPPER> |
Wrap all types in a specified wrapper template.
|
inlinestatic |
Count the number of instances of the specified type.
|
inlinestatic |
Return the position of the specified type.
|
inlinestatic |
Return the position of the type of owner.
|
inlinestatic |
Return the number of types in this pack.
|
inlinestatic |
Return a bool indicating whether the specified type is present.
|
inlinestatic |
Return bool indicating if there are any types in this pack.
|
inlinestatic |
Return bool indicating if all types in this pack are different from each other.
|
static |
Set to the number of types in this pack.