cmoon::meta::value_list


Defined in module <cmoon.meta>


template<auto... Values>
struct value_list;


(1)

A value_list is used to store or manipulate a list of compile-time values.

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

Template parameters

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

Member Types


Member type Definition
index_type std::size_t
types type_list<decltype(Values)...>
type Templated typedef indiciating the Nth type of this value_list
append Templated typedef that is the result of appending the given values to this value_list
concatenate Templated typedef that is the result of concatenating the given value_lists' values to the end of this value_list
filter Templated typedef that is a value_list containing the values from Values... that pass the given predicate
transform Templated typedef that is the result of transforming Values... with the given function
transform_to_types Templated typedef just like transform, but converts Values... to types instead of values
sub_list Templated typedef that is a sub-list of this value_list

Member type definitions

type



template<auto... Values>
template<index_type N>
using value_list<Values...>::type<N> = /* see below */;


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

append



template<auto... Values>
template<auto... Values2>
using value_list<Values...>::append<Values2...> = value_list<Values..., Values2...>;


concatenate



template<auto... Values>
template<auto... ValueLists>
using value_list<Values...>::concatenate<ValueLists...> = /* see below */;


The concatenate alias denotes a value_list that contains all the value of this value_list and all values from each ValueLists.... These values are in the order in which they appear in the pack. Empty value_lists (value_list<>) do not add any values.

filter



template<auto... Values>
template<template<auto> class Predicate>
using value_list<Types...>::filter<Predicate> = /* see below */;


The filter alias denotes a value_list containing values from Values... in which Predicate<Values>::value is true.

transform



template<auto... Values>
template<template<auto> class Function>
using value_list<Values...>::transform<Function> = value_list<Function<Values>::value...>;


transform_to_types



template<auto... Values>
template<template<auto> class Function>
using value_list<Values...>::transform_to_types<Function> = type_list<typename Function<Values>::type...>;


sub_list



template<auto... Values>
template<index_type Offset, index_type Count = -1>
using value_list<Values...>::sub_list<Offset, Count> = /* see below */;


The sub_list alias denotes a value_list containing Count values from Values... that start at the given Offset in the parameter pack.

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

Member functions


Returns the number of values
(public static member function)

Returns the value at index N
(public static member function)

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

Creates a std::tuple from Values...
(public static member function)

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

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

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

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