|
|
using | Tuple = std::tuple< Ts... > |
| |
| template<int I> |
| using | get = __type_pack_element< I, Ts... > |
| | The type at index I in this list. More...
|
| |
| template<typename... Qs> |
| using | prepend = TypeList< Qs..., Ts... > |
| | A TypeList with Qs... added to the start. More...
|
| |
| template<typename... Qs> |
| using | append = TypeList< Ts..., Qs... > |
| | A TypeList with Qs... added to the end. More...
|
| |
| template<int... Is> |
| using | pick = TypeList< __type_pack_element< Is, Ts... >... > |
| | A TypeList comprised of the elements at the listed indices in this one. More...
|
| |
| template<int Start, int End = Size> |
| using | slice = decltype(sliceHelper< Start >(sp::make_int_sequence< End - Start >{})) |
| | A TypeList comprised of elements in the range [Start, End). More...
|
| |
| template<int Ind> |
| using | remove = decltype(removalHelper< Ind >(sp::make_int_sequence< Ind >{}, sp::make_int_sequence< Size - Ind - 1 >{})) |
| | Remove an element from the list. More...
|
| |
| template<int Ind, typename T > |
| using | set = decltype(setHelper< Ind, T >(sp::make_int_sequence< Ind >{}, sp::make_int_sequence< Size - Ind - 1 >{})) |
| | Set a the list element at index Ind to T. More...
|
| |
| template<typename O > |
| using | cat = decltype(catHelper(O{})) |
| | A TypeList formed by concatenating this one with the given one (O) More...
|
| |
| template<int J, typename I > |
| using | insert = typename slice< 0, J >::template append< I >::template cat< slice< J > > |
| | Insert an element at index J. More...
|
| |
| template<template< typename > typename Predicate> |
| using | FindMatchingIndices = decltype(findMatchingIndHelper< Predicate >()) |
| | Find the index of all matching elements. More...
|
| |
| template<template< typename > typename Predicate> |
| using | filter = decltype(filterHelper< Predicate, 0 >()) |
| | The types from this list that meet the given predicate. More...
|
| |
| template<template< typename > typename Lambda> |
| using | map = TypeList< typename Lambda< Ts >::type... > |
| | If Lambda is a template struct that exposes one type member called type, this yields a new TypeList with the result of applying Lambda to each element in this list. More...
|
| |
| template<template< typename, int > typename Lambda> |
| using | mapi = decltype(mapiImpl< Lambda >(sp::make_int_sequence< Size >{})) |
| | Indexed functional map: the predicate receives both the element and its index. More...
|
| |
|
template<typename OtherList > |
| using | merge = decltype(mergeHelper< OtherList >()) |
| |
|
template<typename OtherList > |
| using | uniqueMerge = decltype(uniqueMergeHelper< OtherList >()) |
| |
| template<typename Defer = Deferred> |
| using | sortedUnique = decltype(Defer::template sortedUniqueHelper()) |
| | Get unique elements of a sorted list in linear time. More...
|
| |
| template<typename Defer = Deferred> |
| using | sort = decltype(Defer::template sortHelper()) |
| | Get the sorted version of this list using insertion sort. Caution: O(n²). More...
|
| |
|
| constexpr static int | Size = sizeof...(Ts) |
| | The size of this list. More...
|
| |
|
constexpr static bool | Empty = Size == 0 |
| |
| template<template< typename > typename Predicate> |
| static constexpr bool | All = (Predicate<Ts>::value && ...) |
| | True iff Predicate<T> is true for all T in this list. More...
|
| |
| template<template< typename > typename Predicate> |
| static constexpr bool | Any = (Predicate<Ts>::value || ...) |
| | True iff Predicate<T> is true for any T in this list. More...
|
| |
| template<template< typename > typename Predicate> |
| static constexpr int | CountMatching = (Predicate<Ts>::value + ... + 0) |
| | Count how many elements of the list match the predicate. More...
|
| |
|
template<template< typename > typename Predicate, int Stride = 1, int From = 0> |
| constexpr static int | find = findHelper<Predicate, Stride, From>() |
| |
|
template<typename T , int From = 0> |
| constexpr static int | indexOf = findHelper<sp::tm::TypeEqual<T>::template type, 1, From>() |
| |
|
template<typename T , int From = Size - 1> |
| constexpr static int | reverseIndexOf = findHelper<sp::tm::TypeEqual<T>::template type, -1, From>() |
| |
template<typename... Ts>
class sp::TypeList< Ts >
A compile-time list of types, providing all the usual list primitives.
A system for manipulating lists of types. Has all the features you'd expect from a convenient list implementation, including functional-programming-esque schemes.
Code that manipulates template type parameter packs can often be simplified using TypeList.
Example
template<typename... Ts>
void example() {
using Tensors = TL::template filter<sp::is_tensor>;
using ThirdTensor = Tensors::template get<2>;
ThirdTensor someInstance;
}
A compile-time list of types, providing all the usual list primitives.
Definition: TypeList.hpp:40