1 | template <class T, int... Args> struct C { |
2 | T member; |
3 | bool argsAre_16_32() { return false; } |
4 | }; |
5 | |
6 | template <> struct C<int, 16> { |
7 | int member; |
8 | bool argsAre_16_32() { return false; } |
9 | }; |
10 | |
11 | template <> struct C<int, 16, 32> : C<int, 16> { |
12 | bool argsAre_16_32() { return true; } |
13 | }; |
14 | |
15 | template <class T, typename... Args> struct D { |
16 | T member; |
17 | bool argsAre_Int_bool() { return false; } |
18 | }; |
19 | |
20 | template <> struct D<int, int> { |
21 | int member; |
22 | bool argsAre_Int_bool() { return false; } |
23 | }; |
24 | |
25 | template <> struct D<int, int, bool> : D<int, int> { |
26 | bool argsAre_Int_bool() { return true; } |
27 | }; |
28 | |
29 | template <typename... Args> struct OnlyPack {}; |
30 | template <typename T, typename... Args> struct EmptyPack {}; |
31 | |
32 | int main(int argc, char const *argv[]) { |
33 | EmptyPack<int> emptyPack; |
34 | OnlyPack<int, char, double, D<int, int, bool>> onlyPack; |
35 | |
36 | C<int, 16, 32> myC; |
37 | C<int, 16> myLesserC; |
38 | myC.member = 64; |
39 | (void)C<int, 16, 32>().argsAre_16_32(); |
40 | (void)C<int, 16>().argsAre_16_32(); |
41 | (void)(myC.member != 64); |
42 | D<int, int, bool> myD; |
43 | D<int, int> myLesserD; // breakpoint here |
44 | myD.member = 64; |
45 | (void)D<int, int, bool>().argsAre_Int_bool(); |
46 | (void)D<int, int>().argsAre_Int_bool(); |
47 | |
48 | return 0; // break here |
49 | } |
50 | |