98template<
class...>
struct flatten;
105template<std::
size_t, std::
size_t,
class>
struct get_type_list_sublist;
109template<
class>
struct unwrap;
115template<
template<
class>
class,
class>
struct apply_each;
118template<std::
size_t,
class>
struct get_type_list_member;
119template<std::ptrdiff_t, std::ptrdiff_t, std::
size_t,
class>
159template<
class...T>
static constexpr bool are_type_lists_v = (... && is_type_list_v<T>);
172 typename typelist_::get_type_list_member<I, T>::type;
212template<std::
size_t From, std::
size_t To,
class T>
218template<std::
size_t From, std::
size_t Count,
class T>
227template<std::
size_t Count,
class T>
236template<std::
size_t Count,
class T>
245template<std::
size_t Count,
class T>
254template<std::
size_t Count,
class T>
264template<std::size_t From, std::size_t To,
class...T>
270template<std::size_t From, std::size_t Count,
class...T>
276template<std::size_t Count,
class...T>
282template<std::size_t Count,
class...T>
291template<std::size_t Count,
class...T>
300template<std::size_t Count,
class...T>
321 template<
class>
class Test,
326 typename typelist_::filter_type_list<Test, T, Mod>::type;
334 template<
class>
class Test,
349template<
template<
class>
class F,
class T >
359template<
template<
class>
class F,
class T >
370template<
template<
class>
class F,
class...T >
380template<
template<
class>
class F,
class...T >
388 template<
class>
class Test,
449 std::ptrdiff_t Stride,
454 typename typelist_::type_list_stride<Base, Stride, Count, T>::type;
463 std::ptrdiff_t Stride,
474template<std::
size_t I,
class T>
struct get_type_list_member {};
476template<std::size_t I,
class T1,
class...T>
477struct get_type_list_member<I,
type_list<T1, T...>> {
478 static_assert( I <
sizeof...(T) + 1,
"Index out of range" );
479 using type =
typename get_type_list_member<I-1,
type_list<T...>>::type;
482template<
class T1,
class...T>
struct get_type_list_member<0,
type_list<T1, T...>> {
489template<
template <
class>
class Test,
class T,
test_modifier Mod>
500template<
template <
class>
class Test,
class T,
test_modifier Mod>
502 using type = std::conditional_t<
510template<
template<
class>
class Test,
test_modifier Mod,
class T1,
class T2,
class...Ts>
514 static constexpr std::size_t halfway = all::size / 2;
526template<
template<
class>
class F,
class...T >
541 std::ptrdiff_t SignedBase,
542 std::ptrdiff_t Stride,
546struct type_list_stride_params {
548 static_assert( is_type_list_v< T > );
550 static constexpr std::size_t Base =
551 (std::size_t)(SignedBase >= 0 ? SignedBase : T::size + SignedBase);
554 template<std::
size_t new_index,
bool check = true>
555 static constexpr std::size_t original_index() {
556 static_assert( (!check) || new_index < Count );
557 const std::ptrdiff_t base = Base;
558 return base + ((std::ptrdiff_t)new_index) * Stride;
562 template<std::
size_t original_index,
bool check = true>
563 static constexpr std::size_t new_index() {
574 constexpr std::ptrdiff_t dist = ((std::ptrdiff_t)original_index) - Base;
575 constexpr std::ptrdiff_t new_index_signed = dist/Stride;
576 constexpr std::ptrdiff_t new_index_mod = dist%Stride;
577 constexpr std::size_t new_index = (std::size_t)new_index_signed;
580 (!check) || (new_index >= T::size),
581 "Index out of underlying array bounds."
585 (!check) || (original_index >= Count),
586 "Index out of stride array bounds."
590 (!check) || (new_index_mod == 0),
591 "Index not touched by the stride array."
601 Count == 0 || original_index<Count - 1,
false>() < T::size,
602 "type_list_stride out of bounds."
611 std::ptrdiff_t Stride,
617 using params = type_list_stride_params<Base, Stride, Count, T>;
619 template<
class S>
struct deduce_type;
621 template<std::size_t...N>
struct deduce_type<std::index_sequence<N...>> {
628 using type =
typename deduce_type< std::make_index_sequence<Count> >::type;
646template<>
struct concatenate_type_lists<> {
647 using type = type_list<>;
652 using type = type_list<T...>;
657 static_assert( are_type_lists_v<T1, T2, T3, Ts...> );
658 using type =
typename concatenate_type_lists<
659 typename concatenate_type_lists<T1, T2>::type,
660 typename concatenate_type_lists<T3, Ts...>::type
665template<
class T,
class...Ts>
668 static_assert( is_type_list_v<T> );
669 using type =
typename T::template append<Ts...>;
678template<std::size_t From,
class...T>
679struct get_type_list_sublist<From, From,
type_list<T...>> {
680 static_assert( From <=
sizeof...(T) );
681 using type = type_list<>;
684template<std::size_t From,
class...T>
685struct get_type_list_sublist<From, From+1,
type_list<T...>> {
686 static_assert( From <
sizeof...(T) );
691template<std::size_t From, std::size_t To,
class...T>
692struct get_type_list_sublist<From, To,
type_list<T...>> {
694 static_assert( To >= From,
"Invalid range: To must be no less than From." );
695 static_assert( To > From+1,
"Logic error. Wrong partial specialisation." );
697 using list = type_list<T...>;
699 static constexpr std::size_t from1 = From;
700 static constexpr std::size_t to1 = From + (To - From)/2;
701 static constexpr std::size_t from2 = to1;
702 static constexpr std::size_t to2 = To;
704 using part1 =
typename get_type_list_sublist<from1, to1, list>::type;
705 using part2 =
typename get_type_list_sublist<from2, to2, list>::type;
708 using type = concatenate_type_lists_t< part1, part2 >;
716template<std::
size_t From, std::
size_t To,
class T>
717struct get_type_list_slice :
public get_type_list_sublist<From, To, T> {};
734 "wrapped_list must wrap a wrapped_list or a type_list"
744template<
class T>
struct wrapped_list<wrapped_list<T>> {
745 using type = wrapped_list<T>;
762template<
class T>
struct unwrap {
783template<
class T>
struct flatten<T> {
792template<
class...T>
struct flatten< type_list<T...> > {
793 using type = concatenate_type_lists_t<typename flatten<T>::type...>;
801 using type = type_list<T>;
812 static constexpr std::size_t
size =
sizeof...(T);
815 template<
template<
class...>
class Templ>
using apply_t = Templ<T...>;
828 template<
template<
class...>
class Templ>
using call_t =
829 typename Templ<T...>::type;
873 template<std::
size_t From, std::
size_t To>
881 std::ptrdiff_t Stride,
893 std::ptrdiff_t Stride,
910template<
class T,
class U>
Definition typelist.hpp:96
Definition typelist.hpp:772
Definition typelist.hpp:751
Definition typelist.hpp:639
Encapsulates a list of types.
Definition typelist.hpp:810
prepend_t< U... > prepend
Definition typelist.hpp:849
type_list< T..., U... > append_t
Definition typelist.hpp:855
type_list_stride< Base, Stride, Count, type_list > stride_t
Definition typelist.hpp:884
append_t< U... > append
Definition typelist.hpp:862
typename Templ< T... >::type call_t
Definition typelist.hpp:828
apply_t< Templ > apply
Definition typelist.hpp:822
type_list_sublist< From, To, type_list > sublist_t
Definition typelist.hpp:874
type_list< U..., T... > prepend_t
Definition typelist.hpp:842
call_t< Templ > call
Definition typelist.hpp:836
static constexpr std::size_t size
Definition typelist.hpp:812
stride_t< Base, Stride, Count > stride
Definition typelist.hpp:896
Templ< T... > apply_t
Definition typelist.hpp:815
Definition typelist.hpp:731
type_list_sized_sublist< From, Count, flatten_t< T... > > flatten_sized_sublist
Definition typelist.hpp:271
type_list_sublist< 0, Count, T > type_list_prefix
Definition typelist.hpp:228
type_list_sublist< From, To, flatten_t< T... > > flatten_sublist
Definition typelist.hpp:265
typename get_as_list< T >::type get_as_list_t
Definition typelist.hpp:153
typename typelist_::apply_each< F, T >::class_types type_list_apply_each_class
Definition typelist.hpp:350
type_list_filter< Test, T, Mod > filter_type_list
Definition typelist.hpp:338
type_list_sublist< 0, T::size-Count, T > type_list_remove_suffix
Definition typelist.hpp:255
type_list_filter< Test, flatten_t< T... >, Mod > flatten_filter
Definition typelist.hpp:392
type_list_remove_prefix< Count, flatten_t< T... > > flatten_remove_prefix
Definition typelist.hpp:292
test_modifier
Definition typelist.hpp:68
@ invert_test
Keep types when the Filter returns false.
Definition typelist.hpp:70
@ no_invert_test
Keep types when the Filter returns true.
Definition typelist.hpp:69
type_list_sublist< T::size - Count, T::size, T > type_list_suffix
Definition typelist.hpp:237
typename typelist_::filter_type_list< Test, T, Mod >::type type_list_filter
Definition typelist.hpp:325
typename typelist_::apply_each< F, T >::inner_types type_list_apply_each
Definition typelist.hpp:360
typename flatten< T... >::type flatten_t
Converts the template parameters into a type_list.
Definition typelist.hpp:199
type_list_prefix< Count, flatten_t< T... > > flatten_prefix
Definition typelist.hpp:277
type_list_sublist< From, From+Count, T > type_list_sized_sublist
Definition typelist.hpp:219
typename typelist_::type_list_stride< Base, Stride, Count, T >::type type_list_stride
Definition typelist.hpp:453
type_list_remove_suffix< Count, flatten_t< T... > > flatten_remove_suffix
Definition typelist.hpp:301
typename concatenate_type_lists< T... >::type concatenate_type_lists_t
Definition typelist.hpp:149
type_list_apply_each< F, flatten_t< T... > > flatten_apply_each
Definition typelist.hpp:381
type_list_stride< Base, Stride, Count, flatten_t< T... > > flatten_stride
Definition typelist.hpp:467
type_list_suffix< Count, flatten_t< T... > > flatten_suffix
Definition typelist.hpp:283
typename typelist_::get_type_list_member< I, T >::type type_list_member
Definition typelist.hpp:171
type_list_sublist< Count, T::size, T > type_list_remove_prefix
Definition typelist.hpp:246
type_list_apply_each_class< F, flatten_t< T... > > flatten_apply_each_class
Definition typelist.hpp:371
typename get_type_list_sublist< From, To, T >::type type_list_sublist
Definition typelist.hpp:213