Empirical
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
emp::TypePack< T1, Ts... > Struct Template Reference

#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...
 

Member Typedef Documentation

template<typename T1 , typename... Ts>
template<typename... T>
using emp::TypePack< T1, Ts... >::add = TypePack<T1,Ts...,T...>

Push a new type onto the back of this TypePack.

template<typename T1 , typename... Ts>
template<template< typename... > class TEMPLATE>
using emp::TypePack< T1, Ts... >::apply = TEMPLATE<T1, Ts...>

Apply to a specified template with TypePack as template arguments.

template<typename T1 , typename... Ts>
template<template< typename... > class FILTER>
using emp::TypePack< T1, Ts... >::filter = tp_filter_t<this_t, FILTER>

Remove all types that cannot pass a filter. Return as new TypePack.

template<typename T1 , typename... Ts>
template<template< typename... > class FILTER>
using emp::TypePack< T1, Ts... >::find_t = typename tp_filter_t<this_t, FILTER>::first_t

Return the first type that satisfies a filter.

template<typename T1 , typename... Ts>
using emp::TypePack< T1, Ts... >::first_t = T1

What is the first type in this TypePack?

template<typename T1 , typename... Ts>
template<int POS>
using emp::TypePack< T1, Ts... >::get = pack_id<POS, T1, Ts...>

Get the type associated with a specified position in the pack.

template<typename T1 , typename... Ts>
using emp::TypePack< T1, Ts... >::last_t = last_type<T1,Ts...>

What is the final type in this TypePack?

template<typename T1 , typename... Ts>
template<typename IN >
using emp::TypePack< T1, Ts... >::merge = typename tp_shift<IN::SIZE, this_t, IN>::type1

Join this TypePack with another TypePack.

template<typename T1 , typename... Ts>
template<typename T , int N = 1>
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.

template<typename T1 , typename... Ts>
using emp::TypePack< T1, Ts... >::pop = TypePack<Ts...>

Remove the first type from this TypePack and return the rest.

template<typename T1 , typename... Ts>
template<int N>
using emp::TypePack< T1, Ts... >::popN = typename tp_shift<N, TypePack<>, this_t>::type2
template<typename T1 , typename... Ts>
template<typename... T>
using emp::TypePack< T1, Ts... >::push_back = TypePack<T1,Ts...,T...>

Push a new type onto the back of this TypePack.

template<typename T1 , typename... Ts>
template<typename... T>
using emp::TypePack< T1, Ts... >::push_front = TypePack<T...,T1,Ts...>

Push a new type onto the front of this TypePack.

template<typename T1 , typename... Ts>
template<int N, typename DEFAULT = null_t>
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.

template<typename T1 , typename... Ts>
using emp::TypePack< T1, Ts... >::reverse = typename pop::reverse::template push_back<T1>

Rearrange types in TypePack into reverse order.

template<typename T1 , typename... Ts>
using emp::TypePack< T1, Ts... >::rotate = typename pop::template push_back<T1>

Rotate types through typepack by the specified number of steps.

template<typename T1 , typename... Ts>
template<int... Ps>
using emp::TypePack< T1, Ts... >::select = TypePack< get<Ps>... >

Choose a set of specific positions. Return as new TypePack.

template<typename T1 , typename... Ts>
template<int ID, typename T >
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.

template<typename T1 , typename... Ts>
template<int N>
using emp::TypePack< T1, Ts... >::shrink = typename tp_shift<N, TypePack<>, this_t>::type1

Reduce the size of this TypePack down to N.

template<typename T1 , typename... Ts>
using emp::TypePack< T1, Ts... >::this_t = TypePack<T1, Ts...>

What is the full type of this TypePack?

template<typename T1 , typename... Ts>
template<typename RETURN_T >
using emp::TypePack< T1, Ts... >::to_function_t = RETURN_T(T1,Ts...)

Convert to a function signature with a specified return type.

template<typename T1 , typename... Ts>
template<template< typename... > class WRAPPER>
using emp::TypePack< T1, Ts... >::wrap = tp_wrap_t<this_t, WRAPPER>

Wrap all types in a specified wrapper template.

Member Function Documentation

template<typename T1 , typename... Ts>
template<typename T >
static constexpr size_t emp::TypePack< T1, Ts... >::Count ( )
inlinestatic

Count the number of instances of the specified type.

template<typename T1 , typename... Ts>
template<typename T >
static constexpr int emp::TypePack< T1, Ts... >::GetID ( )
inlinestatic

Return the position of the specified type.

template<typename T1 , typename... Ts>
template<typename T >
static constexpr int emp::TypePack< T1, Ts... >::GetID ( const T &  )
inlinestatic

Return the position of the type of owner.

template<typename T1 , typename... Ts>
static constexpr int emp::TypePack< T1, Ts... >::GetSize ( )
inlinestatic

Return the number of types in this pack.

template<typename T1 , typename... Ts>
template<typename T >
static constexpr bool emp::TypePack< T1, Ts... >::Has ( )
inlinestatic

Return a bool indicating whether the specified type is present.

template<typename T1 , typename... Ts>
static constexpr bool emp::TypePack< T1, Ts... >::IsEmpty ( )
inlinestatic

Return bool indicating if there are any types in this pack.

template<typename T1 , typename... Ts>
static constexpr bool emp::TypePack< T1, Ts... >::IsUnique ( )
inlinestatic

Return bool indicating if all types in this pack are different from each other.

Member Data Documentation

template<typename T1 , typename... Ts>
constexpr int emp::TypePack< T1, Ts... >::SIZE = 1+sizeof...(Ts)
static

Set to the number of types in this pack.


The documentation for this struct was generated from the following file: