75template <
typename H,
typename T>
103template <
typename T1 = NullType,
104 typename T2 = NullType,
105 typename T3 = NullType,
106 typename T4 = NullType,
107 typename T5 = NullType,
108 typename T6 = NullType,
109 typename T7 = NullType,
110 typename T8 = NullType,
111 typename T9 = NullType,
112 typename T10 = NullType,
113 typename T11 = NullType,
114 typename T12 = NullType,
115 typename T13 = NullType,
116 typename T14 = NullType,
117 typename T15 = NullType,
118 typename T16 = NullType,
119 typename T17 = NullType,
120 typename T18 = NullType,
121 typename T19 = NullType,
122 typename T20 = NullType,
123 typename T21 = NullType,
124 typename T22 = NullType,
125 typename T23 = NullType,
126 typename T24 = NullType>
130 using TailType =
typename MakeTypeList<T2,
155 using Type = TypeList<T1, TailType>;
160 using Type = NullType;
163template <
typename TTypeList>
177template <
typename H,
typename T>
178struct Length<TypeList<H, T>>
182 Type = 1 + Length<T>::Type
188struct Length<NullType>
211template <
class TTypeList,
unsigned int index>
214template <
class Head,
class Tail>
215struct TypeAt<TypeList<Head, Tail>, 0>
220template <
class Head,
class Tail,
unsigned int i>
221struct TypeAt<TypeList<Head, Tail>, i>
223 using Type =
typename TypeAt<Tail, i - 1>::Type;
226template <
unsigned int i>
227struct TypeAt<NullType, i>
229 using Type = NullType;
232template <
class TTypeList1,
class TTypeList2>
255template <
class Head,
class Tail,
class T>
256struct Append<TypeList<Head, Tail>, T>
258 using Type = TypeList<Head, typename Append<Tail, T>::Type>;
263struct Append<NullType, NullType>
265 using Type = NullType;
268struct Append<NullType, T>
270 using Type = TypeList<T, NullType>;
273struct Append<T, NullType>
275 using Type = TypeList<T, NullType>;
277template <
class Head,
class Tail>
278struct Append<NullType, TypeList<Head, Tail>>
280 using Type = TypeList<Head, Tail>;
282template <
class Head,
class Tail>
283struct Append<TypeList<Head, Tail>, NullType>
285 using Type = TypeList<Head, Tail>;
291template <
class TList,
class T>
295struct Erase<NullType, T>
297 using Type = NullType;
300template <
class T,
class Tail>
301struct Erase<TypeList<T, Tail>, T>
306template <
class Head,
class Tail,
class T>
307struct Erase<TypeList<Head, Tail>, T>
309 using Type = TypeList<Head, typename Erase<Tail, T>::Type>;
315template <
class TList,
class T>
318struct EraseAll<NullType, T>
320 using Type = NullType;
322template <
class T,
class Tail>
323struct EraseAll<TypeList<T, Tail>, T>
325 using Type =
typename EraseAll<Tail, T>::Type;
327template <
class Head,
class Tail,
class T>
328struct EraseAll<TypeList<Head, Tail>, T>
330 using Type = TypeList<Head, typename EraseAll<Tail, T>::Type>;
336template <
class TList>
340struct NoDuplicates<NullType>
342 using Type = NullType;
345template <
class Head,
class Tail>
346struct NoDuplicates<TypeList<Head, Tail>>
349 using L1 =
typename NoDuplicates<Tail>::Type;
350 using L2 =
typename Erase<L1, Head>::Type;
353 using Type = TypeList<Head, L2>;
359template <
class TList,
class T,
class U>
362template <
class T,
class U>
363struct Replace<NullType, T, U>
365 using Type = NullType;
368template <
class T,
class Tail,
class U>
369struct Replace<TypeList<T, Tail>, T, U>
371 using Type = TypeList<U, Tail>;
374template <
class Head,
class Tail,
class T,
class U>
375struct Replace<TypeList<Head, Tail>, T, U>
377 using Type = TypeList<Head, typename Replace<Tail, T, U>::Type>;
383template <
class TList,
class T,
class U>
386template <
class T,
class U>
387struct ReplaceAll<NullType, T, U>
389 using Type = NullType;
392template <
class T,
class Tail,
class U>
393struct ReplaceAll<TypeList<T, Tail>, T, U>
395 using Type = TypeList<U, typename ReplaceAll<Tail, T, U>::Type>;
398template <
class Head,
class Tail,
class T,
class U>
399struct ReplaceAll<TypeList<Head, Tail>, T, U>
401 using Type = TypeList<Head, typename ReplaceAll<Tail, T, U>::Type>;
407template <
class TList>
411struct Reverse<NullType>
413 using Type = NullType;
416template <
class Head,
class Tail>
417struct Reverse<TypeList<Head, Tail>>
419 using Type =
typename Append<typename Reverse<Tail>::Type, Head>::Type;
436template <
class TTypeList,
class TType>
438template <
class TType>
439struct IndexOf<NullType, TType>
446template <
class TType,
class TTail>
447struct IndexOf<TypeList<TType, TTail>, TType>
454template <
class Head,
class TTail,
class TType>
455struct IndexOf<TypeList<Head, TTail>, TType>
460 temp = IndexOf<TTail, TType>::Type
466 Type = (temp == -1 ? -1 : 1 + temp)
482template <
class TTypeList,
class TType>
484template <
class TType>
485struct HasType<NullType, TType>
492template <
class TType,
class TTail>
493struct HasType<TypeList<TType, TTail>, TType>
500template <
class Head,
class TTail,
class TType>
501struct HasType<TypeList<Head, TTail>, TType>
505 Type = HasType<TTail, TType>::Type
527template <
class TTypeList>
530 template <
class Predicate>
532 operator()(Predicate & visitor)
534 using Head =
typename TTypeList::Head;
535 using Tail =
typename TTypeList::Tail;
536 visitor.template operator()<Head>();
538 next.template operator()<Predicate>(visitor);
542 template <
class Predicate>
544 operator()(
const Predicate & visitor)
546 using Head =
typename TTypeList::Head;
547 using Tail =
typename TTypeList::Tail;
548 visitor.template operator()<Head>();
550 next.template operator()<Predicate>(visitor);
555struct Visit<NullType>
557 template <
class Predicate>
559 operator()(
const Predicate &)
579template <
class TTypeList,
unsigned int Dimension>
582 template <
class Predicate>
584 operator()(Predicate & visitor)
586 using Head =
typename TTypeList::Head;
587 using Tail =
typename TTypeList::Tail;
588 visitor.template operator()<Head, Dimension>();
589 VisitDimension<Tail, Dimension> next;
590 next.template operator()<Predicate>(visitor);
594 template <
class Predicate>
596 operator()(
const Predicate & visitor)
598 using Head =
typename TTypeList::Head;
599 using Tail =
typename TTypeList::Tail;
600 visitor.template operator()<Head, Dimension>();
601 VisitDimension<Tail, Dimension> next;
602 next.template operator()<Predicate>(visitor);
606template <
unsigned int Dimension>
607struct VisitDimension<NullType, Dimension>
609 template <
class Predicate>
611 operator()(
const Predicate &)
633template <
typename TLeftTypeList,
typename TRightTypeList>
636template <
typename TLeftTypeList,
typename TRightTypeList>
640 template <
typename Visitor>
642 operator()(Visitor & visitor)
const
644 DualVisitImpl<TLeftTypeList, TRightTypeList> impl;
645 return impl.template operator()<Visitor>(visitor);
649 template <
typename Visitor>
651 operator()(
const Visitor & visitor)
const
653 DualVisitImpl<TLeftTypeList, TRightTypeList> impl;
654 return impl.template operator()<Visitor>(visitor);
671template <
typename TLeftTypeList,
typename TRightTypeList>
674 template <
typename Visitor>
676 operator()(Visitor & visitor)
const
678 using LeftTail =
typename TLeftTypeList::Tail;
680 DualVisitImpl<TLeftTypeList, TRightTypeList> goRight;
681 goRight.visitRHS<Visitor>(visitor);
683 DualVisitImpl<LeftTail, TRightTypeList> goLeft;
684 goLeft.template operator()<Visitor>(visitor);
688 template <
typename Visitor>
690 operator()(
const Visitor & visitor)
const
692 using LeftTail =
typename TLeftTypeList::Tail;
694 DualVisitImpl<TLeftTypeList, TRightTypeList> goRight;
695 goRight.visitRHS<Visitor>(visitor);
697 DualVisitImpl<LeftTail, TRightTypeList> goLeft;
698 goLeft.template operator()<Visitor>(visitor);
702 template <
typename Visitor>
704 visitRHS(Visitor & visitor)
const
706 using LeftHead =
typename TLeftTypeList::Head;
707 using RightHead =
typename TRightTypeList::Head;
708 using RightTail =
typename TRightTypeList::Tail;
710 visitor.template operator()<LeftHead, RightHead>();
712 DualVisitImpl<TLeftTypeList, RightTail> goRight;
713 goRight.template visitRHS<Visitor>(visitor);
717 template <
typename Visitor>
719 visitRHS(
const Visitor & visitor)
const
721 using LeftHead =
typename TLeftTypeList::Head;
722 using RightHead =
typename TRightTypeList::Head;
723 using RightTail =
typename TRightTypeList::Tail;
725 visitor.template operator()<LeftHead, RightHead>();
727 DualVisitImpl<TLeftTypeList, RightTail> goRight;
728 goRight.template visitRHS<Visitor>(visitor);
732template <
typename TRightTypeList>
733struct DualVisitImpl<typelist::NullType, TRightTypeList>
735 template <
typename Visitor>
737 operator()(
const Visitor &)
const
740template <
typename TLeftTypeList>
741struct DualVisitImpl<TLeftTypeList, typelist::NullType>
743 template <
typename Visitor>
745 operator()(
const Visitor &)
const
748 template <
typename Visitor>
750 visitRHS(
const Visitor &)
const
755struct DualVisitImpl<typelist::NullType, typelist::NullType>
757 template <
typename Visitor>
759 operator()(
const Visitor &)
const
783template <
typename TLeftTypeList,
typename TRightTypeList,
unsigned int Dimension>
784struct DualVisitDimensionImpl;
786template <
typename TLeftTypeList,
typename TRightTypeList,
unsigned int Dimension>
787struct DualVisitDimension
790 template <
typename Visitor>
792 operator()(Visitor & visitor)
const
794 DualVisitDimensionImpl<TLeftTypeList, TRightTypeList, Dimension> impl;
795 return impl.template operator()<Visitor>(visitor);
799 template <
typename Visitor>
801 operator()(
const Visitor & visitor)
const
803 DualVisitDimensionImpl<TLeftTypeList, TRightTypeList, Dimension> impl;
804 return impl.template operator()<Visitor>(visitor);
821template <
typename TLeftTypeList,
typename TRightTypeList,
unsigned int Dimension>
822struct DualVisitDimensionImpl
824 template <
typename Visitor>
826 operator()(Visitor & visitor)
const
828 using LeftTail =
typename TLeftTypeList::Tail;
830 DualVisitDimensionImpl<TLeftTypeList, TRightTypeList, Dimension> goRight;
831 goRight.visitRHS<Visitor>(visitor);
833 DualVisitDimensionImpl<LeftTail, TRightTypeList, Dimension> goLeft;
834 goLeft.template operator()<Visitor>(visitor);
838 template <
typename Visitor>
840 operator()(
const Visitor & visitor)
const
842 using LeftTail =
typename TLeftTypeList::Tail;
844 DualVisitDimensionImpl<TLeftTypeList, TRightTypeList, Dimension> goRight;
845 goRight.visitRHS<Visitor>(visitor);
847 DualVisitDimensionImpl<LeftTail, TRightTypeList, Dimension> goLeft;
848 goLeft.template operator()<Visitor>(visitor);
852 template <
typename Visitor>
854 visitRHS(Visitor & visitor)
const
856 using LeftHead =
typename TLeftTypeList::Head;
857 using RightHead =
typename TRightTypeList::Head;
858 using RightTail =
typename TRightTypeList::Tail;
860 visitor.template operator()<LeftHead, RightHead, Dimension>();
862 DualVisitDimensionImpl<TLeftTypeList, RightTail, Dimension> goRight;
863 goRight.template visitRHS<Visitor>(visitor);
867 template <
typename Visitor>
869 visitRHS(
const Visitor & visitor)
const
871 using LeftHead =
typename TLeftTypeList::Head;
872 using RightHead =
typename TRightTypeList::Head;
873 using RightTail =
typename TRightTypeList::Tail;
875 visitor.template operator()<LeftHead, RightHead, Dimension>();
877 DualVisitDimensionImpl<TLeftTypeList, RightTail, Dimension> goRight;
878 goRight.template visitRHS<Visitor>(visitor);
882template <
typename TRightTypeList,
unsigned int Dimension>
883struct DualVisitDimensionImpl<typelist::NullType, TRightTypeList, Dimension>
885 template <
typename Visitor>
887 operator()(
const Visitor &)
const
890template <
typename TLeftTypeList,
unsigned int Dimension>
891struct DualVisitDimensionImpl<TLeftTypeList, typelist::NullType, Dimension>
893 template <
typename Visitor>
895 operator()(
const Visitor &)
const
898 template <
typename Visitor>
900 visitRHS(
const Visitor &)
const
904template <
unsigned int Dimension>
905struct DualVisitDimensionImpl<typelist::NullType, typelist::NullType, Dimension>
907 template <
typename Visitor>
909 operator()(
const Visitor &)
const