Debian Codegraph @

yo/advancedtemplates/examples/append.h

raw
1 #ifndef INCLUDED_APPEND_H_
2 #define INCLUDED_APPEND_H_
3
4 #include "typelist.h"
5
6 //STRUCTS
7 template <typename ...Types>
8 struct Append;
9
10 template <typename ...Types>
11 struct Prefix;
12 //=
13
14 //ADDTYPE
15 template <typename NewType, typename ...Types>
16 struct Append<TypeList<Types...>, NewType>
17 {
18 using List = TypeList<Types..., NewType>;
19 };
20
21 template <typename NewType, typename ...Types>
22 struct Prefix<NewType, TypeList<Types...>>
23 {
24 using List = TypeList<NewType, Types...>;
25 };
26 //=
27
28 #endif