19static_assert(Null_v<Nil>);
20static_assert(!Null_v<Example>);
22static_assert(0 == Length_v<Nil>);
23static_assert(2 == Length_v<Example>);
25static_assert(is_same_v<int, Head_t<Example>>);
29static_assert(is_same_v<int, Head_t<conditional_t<true, Example, Nil>>>);
31 :
Head<conditional_t<Null_v<T>, Example, T>>{};
32static_assert(is_same_v<int, ShortCircuiting<Nil>::type>);
33static_assert(is_same_v<double, ShortCircuiting<List<double>>::type>);
37static_assert(is_same_v<int, First_t<Example>>);
38static_assert(is_same_v<double, Second_t<Example>>);
40static_assert(is_same_v<Example, Cons_t<int, Cons_t<double, Nil>>>);
41static_assert(is_same_v<Example, PushFront_t<PushFront_t<Nil, double>,
int>>);
42static_assert(is_same_v<Example, PushBack_t<PushBack_t<Nil, int>,
double>>);
44static_assert(is_same_v<Nil, NonEmptyTails_t<Nil>>);
50static_assert(is_same_v<double, Last_t<Example>>);
53static_assert(is_same_v<Example, Map_t<Identity, Example>>);
54static_assert(is_same_v<List<const int, const double>,
56static_assert(is_same_v<List<const int&, const double &>,
58static_assert(is_same_v<List<const int*&, const double *&>,
62static_assert(is_same_v<List<int *const &, double *const &>,
69static_assert(is_same_v<Nil, MapList_t<Fn<Length_t>,
Nil>>);
70static_assert(is_same_v<
75static_assert(is_same_v<tuple<const int, const double>,
78static_assert(is_same_v<Example, Bind_t<tuple<int, double>>>);
79static_assert(is_same_v<Example, Bind_t<pair<int, double>>>);
82static_assert(is_same_v<Nil, Append_t<>>);
83static_assert(is_same_v<Example, Append_t<Example>>);
84static_assert(is_same_v<List<int, double, char>,
87static_assert(is_same_v<List<Example, List<int>>,
90static_assert(is_same_v<List<Example, List<double>>,
95static_assert(is_same_v<const int, Call_t<MaybeConst<true>,
int>>);
96static_assert(is_same_v<int, Call_t<MaybeConst<false>,
int>>);
98static_assert(is_same_v<List<const int, const double>,
100static_assert(is_same_v<Example, MapConst_t<false, Example>>);
102static_assert(Is_v<Fn<Null>,
Nil>);
103static_assert(!Is_v<Fn<Null>,
Example>);
104static_assert(!Is_v<Not<Fn<Null>>,
Nil>);
105static_assert(Is_v<Not<Fn<Null>>,
Example>);
108static_assert(Is_v<HeadIsInt, Example>);
113static_assert(!Is_v<StartsWithInt, Nil>);
114static_assert(Is_v<StartsWithInt, Example>);
117static_assert(Is_v<NullOrStartsWithInt, Nil>);
118static_assert(Is_v<NullOrStartsWithInt, Example>);
120static_assert(Every_v<Fn<is_arithmetic>,
Example>);
121static_assert(is_base_of_v<true_type, Every<Fn<is_arithmetic>,
Example>>);
122static_assert(!Every_v<Fn<is_integral>,
Example>);
123static_assert(is_base_of_v<is_integral<double>,
126static_assert(Some_v<Fn<is_integral>,
Example>);
127static_assert(is_base_of_v<is_integral<int>,
129static_assert(!Some_v<Fn<is_void>,
Example>);
130static_assert(is_base_of_v<false_type, Some<Fn<is_void>,
Example>>);
132static_assert(NotEvery_v<Fn<is_floating_point>,
Example>);
133static_assert(NotAny_v<Fn<is_void>,
Example>);
135static_assert(!In_v<void, Example>);
136static_assert(In_v<int, Example>);
141static_assert(HasBaseIn_v<D, List<B>>);
142static_assert(HasBaseIn_v<D, List<D>>);
143static_assert(HasBaseIn_v<B, List<B>>);
144static_assert(!HasBaseIn_v<B, List<D>>);
145static_assert(HasBaseIn_v<B, List<B, D>>);
147static_assert(is_same_v<List<Nil, Example>,
151static_assert(is_same_v<List<Example, Nil>,
154static_assert(is_same_v<Nil, Filter_t<Fn<is_void>,
Example>>);
156static_assert(is_same_v<Example, Filter_t<Fn<is_arithmetic>,
Example>>);
159static_assert(is_same_v<List<unsigned>,
161static_assert(is_same_v<List<unsigned, double>,
Metaprogramming utilities for manipulating lists of types.
Utilities for compile-time type manipulation. Some terminology as in Lisp.
typename NonEmptyTails< TypeList >::type NonEmptyTails_t
typename Bind< TupleLike >::type Bind_t
typename Tails< TypeList >::type Tails_t
typename LeftFoldList< Op, TypeList, Initial >::type LeftFoldList_t
typename StablePartition< Predicate, TypeList >::type StablePartition_t
typename Tail< TypeList >::type Tail_t
typename Filter< Predicate, TypeList >::type Filter_t
typename ButLast< TypeList >::type ButLast_t
typename Reverse< TypeList >::type Reverse_t
typename Apply< Template, TypeList >::type Apply_t
typename Map< Metafunction, TypeList >::type Map_t
typename MapList< Metafunction, TypeList >::type MapList_t
typename MapConst< Const, TypeList >::type MapConst_t
typename Cons< Type, TypeList >::type Cons_t
typename RightFoldList< Op, TypeList, Initial >::type RightFoldList_t
typename Append< Lists... >::type Append_t
Cons_t< unsigned, Example > Example2
Delays expansion of nested alias head; so Head<Nil> is legal.
Primary template for a list of arbitrary types.