cmoon::meta::type_list


Defined in module <cmoon.meta>


template<typename... Types>
struct type_list;


(1)

A type_list is used to store or manipulate a list of types. Similiar to a std::tuple, it has functionality to get a type at a given index, get its overall size, and extra functionality that std::tuple does not have.

A type_list is not meant to be instantiated, but used as a type only.

Template parameters

Types... - Types that are part of this list

Member Types


Member type Definition
index_type std::size_t
type Templated typedef indiciating the Nth type of this type_list
append Templated typedef that is the result of appending the given types to this type_list
concatenate Templated typedef that is the result of concatenating the given type_lists' types to the end of this type_list
filter Templated typedef that is a type_list containing the types from Types... that pass the given predicate
transform Templated typedef that is the result of transforming Types... with the given function
sub_list Templated typedef that is a sub-list of this type_list
unique Templated typedef that is this type_list with duplicate types removed
find Templated typedef of a type from this type_list that first matches the given predicate
complete_type Templated typedef of a templated type whose templates are filled in by Types... and optional extra types

Member type definitions

type



template<typename... Types>
template<index_type N>
using type_list<Types...>::type<N> = /* see below */;


The type alias denotes a type that is the Nth type from the type_list's Types... parameter pack, starting at 0.

append



template<typename... Types>
template<typename... Types2>
using type_list<Types...>::append<Types2...> = type_list<Types..., Types2...>;


concatenate



template<typename... Types>
template<typename... TypeLists>
using type_list<Types...>::concatenate<TypesLists...> = /* see below */;


The concatenate alias denotes a type_list that contains all the types of this type_list and all types from each TypeLists.... These types are in the order in which they appear in the pack. Empty type_lists (type_list<>) do not add any types.

filter



template<typename... Types>
template<template<typename> class Predicate>
using type_list<Types...>::filter<Predicate> = /* see below */;


The filter alias denotes a type_list containing types from Types... in which Predicate<Types>::value is true.

transform



template<typename... Types>
template<template<typename> class Function>
using type_list<Types...>::transform<Function> = type_list<typename Function<Types>::type...>;


sub_list



template<typename... Types>
template<index_type Offset, index_type Count = -1>
using type_list<Types...>::sub_list<Offset, Count> = /* see below */;


The sub_list alias denotes a type_list containing Count types from Types... that start at the given Offset in the parameter pack.

Calling sub_list with an Offset that is larger than or equal to sizeof...(Types) is ill-formed.

unique



template<typename... Types>
using type_list<Types...>::unique = /* see below */;


The unique alias denotes a type_list containing only one of each type from its original type_list.

find



template<typename... Types>
template<template<typename> class Predicate>
using type_list<Types...>::find<Predicate> = /* see below */;


The find alias denotes a type from this type_list in which Predicate<Types>::value is true first. If there is no type in which Predicate<Types>::value is true, then the program is ill-formed.

complete_type



template<typename... Types>
template<template<typename...> typename T, typename... ExtraArgs>
using type_list<Types...>::complete_type<T, ExtraArgs...> = T<Types..., ExtraArgs...>;


Member functions


Returns the number of types
(public static member function)

Returns the index of a given type
(public static member function)

Checks if a given type is present
(public static member function)

Checks if all types are unique
(public static member function)

Checks if all types are the same
(public static member function)

Checks if all types return true from the given predicate
(public static member function)

Checks if any types return true from the given predicate
(public static member function)

Checks if no types return true from the given predicate
(public static member function)

Calls the given function with each type
(public static member function)

Checks if it is well-formed to call find with the given predicate
(public static member function)