@@ -15,19 +15,19 @@ struct X { operator int() const { return I; } };
15
15
[[nodiscard]] auto main () -> int{
16
16
17
17
std::variant<X<0 >,X<1 >,X<2 >,X<3 >,X<4 >,X<5 >,X<6 >,X<7 >,X<8 >,X<9 >,X<10 >,X<11 >,X<12 >,X<13 >,X<14 >,X<15 >,X<16 >,X<17 >,X<18 >,X<19 >> v {
18
- X<0 >()};
18
+ X<0 >()};
19
19
20
20
// lvalue reference
21
- v = X< 0 >(); std::cout << " v as X< 0> = " + cpp2::to_string (int (cpp2::as_<X<0 >>(v))) << std::endl;
22
- v = X< 1 >(); std::cout << " v as X< 1> = " + cpp2::to_string (int (cpp2::as_<X<1 >>(v))) << std::endl;
23
- v = X< 2 >(); std::cout << " v as X< 2> = " + cpp2::to_string (int (cpp2::as_<X<2 >>(v))) << std::endl;
24
- v = X< 3 >(); std::cout << " v as X< 3> = " + cpp2::to_string (int (cpp2::as_<X<3 >>(v))) << std::endl;
25
- v = X< 4 >(); std::cout << " v as X< 4> = " + cpp2::to_string (int (cpp2::as_<X<4 >>(v))) << std::endl;
26
- v = X< 5 >(); std::cout << " v as X< 5> = " + cpp2::to_string (int (cpp2::as_<X<5 >>(v))) << std::endl;
27
- v = X< 6 >(); std::cout << " v as X< 6> = " + cpp2::to_string (int (cpp2::as_<X<6 >>(v))) << std::endl;
28
- v = X< 7 >(); std::cout << " v as X< 7> = " + cpp2::to_string (int (cpp2::as_<X<7 >>(v))) << std::endl;
29
- v = X< 8 >(); std::cout << " v as X< 8> = " + cpp2::to_string (int (cpp2::as_<X<8 >>(v))) << std::endl;
30
- v = X< 9 >(); std::cout << " v as X< 9> = " + cpp2::to_string (int (cpp2::as_<X<9 >>(v))) << std::endl;
21
+ v = X<0 >(); std::cout << " v as X< 0> = " + cpp2::to_string (int (cpp2::as_<X<0 >>(v))) << std::endl;
22
+ v = X<1 >(); std::cout << " v as X< 1> = " + cpp2::to_string (int (cpp2::as_<X<1 >>(v))) << std::endl;
23
+ v = X<2 >(); std::cout << " v as X< 2> = " + cpp2::to_string (int (cpp2::as_<X<2 >>(v))) << std::endl;
24
+ v = X<3 >(); std::cout << " v as X< 3> = " + cpp2::to_string (int (cpp2::as_<X<3 >>(v))) << std::endl;
25
+ v = X<4 >(); std::cout << " v as X< 4> = " + cpp2::to_string (int (cpp2::as_<X<4 >>(v))) << std::endl;
26
+ v = X<5 >(); std::cout << " v as X< 5> = " + cpp2::to_string (int (cpp2::as_<X<5 >>(v))) << std::endl;
27
+ v = X<6 >(); std::cout << " v as X< 6> = " + cpp2::to_string (int (cpp2::as_<X<6 >>(v))) << std::endl;
28
+ v = X<7 >(); std::cout << " v as X< 7> = " + cpp2::to_string (int (cpp2::as_<X<7 >>(v))) << std::endl;
29
+ v = X<8 >(); std::cout << " v as X< 8> = " + cpp2::to_string (int (cpp2::as_<X<8 >>(v))) << std::endl;
30
+ v = X<9 >(); std::cout << " v as X< 9> = " + cpp2::to_string (int (cpp2::as_<X<9 >>(v))) << std::endl;
31
31
v = X<10 >(); std::cout << " v as X<10> = " + cpp2::to_string (int (cpp2::as_<X<10 >>(v))) << std::endl;
32
32
v = X<11 >(); std::cout << " v as X<11> = " + cpp2::to_string (int (cpp2::as_<X<11 >>(v))) << std::endl;
33
33
v = X<12 >(); std::cout << " v as X<12> = " + cpp2::to_string (int (cpp2::as_<X<12 >>(v))) << std::endl;
@@ -40,16 +40,16 @@ struct X { operator int() const { return I; } };
40
40
v = X<19 >(); std::cout << " v as X<19> = " + cpp2::to_string (int (cpp2::as_<X<19 >>(v))) << std::endl;
41
41
42
42
// const lvalue reference
43
- v = X< 0 >(); std::cout << " as_const(v) as X< 0> = " + cpp2::to_string (int (cpp2::as_<X<0 >>(std::as_const (v)))) << std::endl;
44
- v = X< 1 >(); std::cout << " as_const(v) as X< 1> = " + cpp2::to_string (int (cpp2::as_<X<1 >>(std::as_const (v)))) << std::endl;
45
- v = X< 2 >(); std::cout << " as_const(v) as X< 2> = " + cpp2::to_string (int (cpp2::as_<X<2 >>(std::as_const (v)))) << std::endl;
46
- v = X< 3 >(); std::cout << " as_const(v) as X< 3> = " + cpp2::to_string (int (cpp2::as_<X<3 >>(std::as_const (v)))) << std::endl;
47
- v = X< 4 >(); std::cout << " as_const(v) as X< 4> = " + cpp2::to_string (int (cpp2::as_<X<4 >>(std::as_const (v)))) << std::endl;
48
- v = X< 5 >(); std::cout << " as_const(v) as X< 5> = " + cpp2::to_string (int (cpp2::as_<X<5 >>(std::as_const (v)))) << std::endl;
49
- v = X< 6 >(); std::cout << " as_const(v) as X< 6> = " + cpp2::to_string (int (cpp2::as_<X<6 >>(std::as_const (v)))) << std::endl;
50
- v = X< 7 >(); std::cout << " as_const(v) as X< 7> = " + cpp2::to_string (int (cpp2::as_<X<7 >>(std::as_const (v)))) << std::endl;
51
- v = X< 8 >(); std::cout << " as_const(v) as X< 8> = " + cpp2::to_string (int (cpp2::as_<X<8 >>(std::as_const (v)))) << std::endl;
52
- v = X< 9 >(); std::cout << " as_const(v) as X< 9> = " + cpp2::to_string (int (cpp2::as_<X<9 >>(std::as_const (v)))) << std::endl;
43
+ v = X<0 >(); std::cout << " as_const(v) as X< 0> = " + cpp2::to_string (int (cpp2::as_<X<0 >>(std::as_const (v)))) << std::endl;
44
+ v = X<1 >(); std::cout << " as_const(v) as X< 1> = " + cpp2::to_string (int (cpp2::as_<X<1 >>(std::as_const (v)))) << std::endl;
45
+ v = X<2 >(); std::cout << " as_const(v) as X< 2> = " + cpp2::to_string (int (cpp2::as_<X<2 >>(std::as_const (v)))) << std::endl;
46
+ v = X<3 >(); std::cout << " as_const(v) as X< 3> = " + cpp2::to_string (int (cpp2::as_<X<3 >>(std::as_const (v)))) << std::endl;
47
+ v = X<4 >(); std::cout << " as_const(v) as X< 4> = " + cpp2::to_string (int (cpp2::as_<X<4 >>(std::as_const (v)))) << std::endl;
48
+ v = X<5 >(); std::cout << " as_const(v) as X< 5> = " + cpp2::to_string (int (cpp2::as_<X<5 >>(std::as_const (v)))) << std::endl;
49
+ v = X<6 >(); std::cout << " as_const(v) as X< 6> = " + cpp2::to_string (int (cpp2::as_<X<6 >>(std::as_const (v)))) << std::endl;
50
+ v = X<7 >(); std::cout << " as_const(v) as X< 7> = " + cpp2::to_string (int (cpp2::as_<X<7 >>(std::as_const (v)))) << std::endl;
51
+ v = X<8 >(); std::cout << " as_const(v) as X< 8> = " + cpp2::to_string (int (cpp2::as_<X<8 >>(std::as_const (v)))) << std::endl;
52
+ v = X<9 >(); std::cout << " as_const(v) as X< 9> = " + cpp2::to_string (int (cpp2::as_<X<9 >>(std::as_const (v)))) << std::endl;
53
53
v = X<10 >(); std::cout << " as_const(v) as X<10> = " + cpp2::to_string (int (cpp2::as_<X<10 >>(std::as_const (v)))) << std::endl;
54
54
v = X<11 >(); std::cout << " as_const(v) as X<11> = " + cpp2::to_string (int (cpp2::as_<X<11 >>(std::as_const (v)))) << std::endl;
55
55
v = X<12 >(); std::cout << " as_const(v) as X<12> = " + cpp2::to_string (int (cpp2::as_<X<12 >>(std::as_const (v)))) << std::endl;
@@ -62,16 +62,16 @@ struct X { operator int() const { return I; } };
62
62
v = X<19 >(); std::cout << " as_const(v) as X<19> = " + cpp2::to_string (int (cpp2::as_<X<19 >>(std::as_const (v)))) << std::endl;
63
63
64
64
// rvalue reference
65
- v = X< 0 >(); std::cout << " move(v) as X< 0> = " + cpp2::to_string (int (cpp2::as_<X<0 >>((std::move (v))))) << std::endl;
66
- v = X< 1 >(); std::cout << " move(v) as X< 1> = " + cpp2::to_string (int (cpp2::as_<X<1 >>((std::move (v))))) << std::endl;
67
- v = X< 2 >(); std::cout << " move(v) as X< 2> = " + cpp2::to_string (int (cpp2::as_<X<2 >>((std::move (v))))) << std::endl;
68
- v = X< 3 >(); std::cout << " move(v) as X< 3> = " + cpp2::to_string (int (cpp2::as_<X<3 >>((std::move (v))))) << std::endl;
69
- v = X< 4 >(); std::cout << " move(v) as X< 4> = " + cpp2::to_string (int (cpp2::as_<X<4 >>((std::move (v))))) << std::endl;
70
- v = X< 5 >(); std::cout << " move(v) as X< 5> = " + cpp2::to_string (int (cpp2::as_<X<5 >>((std::move (v))))) << std::endl;
71
- v = X< 6 >(); std::cout << " move(v) as X< 6> = " + cpp2::to_string (int (cpp2::as_<X<6 >>((std::move (v))))) << std::endl;
72
- v = X< 7 >(); std::cout << " move(v) as X< 7> = " + cpp2::to_string (int (cpp2::as_<X<7 >>((std::move (v))))) << std::endl;
73
- v = X< 8 >(); std::cout << " move(v) as X< 8> = " + cpp2::to_string (int (cpp2::as_<X<8 >>((std::move (v))))) << std::endl;
74
- v = X< 9 >(); std::cout << " move(v) as X< 9> = " + cpp2::to_string (int (cpp2::as_<X<9 >>((std::move (v))))) << std::endl;
65
+ v = X<0 >(); std::cout << " move(v) as X< 0> = " + cpp2::to_string (int (cpp2::as_<X<0 >>((std::move (v))))) << std::endl;
66
+ v = X<1 >(); std::cout << " move(v) as X< 1> = " + cpp2::to_string (int (cpp2::as_<X<1 >>((std::move (v))))) << std::endl;
67
+ v = X<2 >(); std::cout << " move(v) as X< 2> = " + cpp2::to_string (int (cpp2::as_<X<2 >>((std::move (v))))) << std::endl;
68
+ v = X<3 >(); std::cout << " move(v) as X< 3> = " + cpp2::to_string (int (cpp2::as_<X<3 >>((std::move (v))))) << std::endl;
69
+ v = X<4 >(); std::cout << " move(v) as X< 4> = " + cpp2::to_string (int (cpp2::as_<X<4 >>((std::move (v))))) << std::endl;
70
+ v = X<5 >(); std::cout << " move(v) as X< 5> = " + cpp2::to_string (int (cpp2::as_<X<5 >>((std::move (v))))) << std::endl;
71
+ v = X<6 >(); std::cout << " move(v) as X< 6> = " + cpp2::to_string (int (cpp2::as_<X<6 >>((std::move (v))))) << std::endl;
72
+ v = X<7 >(); std::cout << " move(v) as X< 7> = " + cpp2::to_string (int (cpp2::as_<X<7 >>((std::move (v))))) << std::endl;
73
+ v = X<8 >(); std::cout << " move(v) as X< 8> = " + cpp2::to_string (int (cpp2::as_<X<8 >>((std::move (v))))) << std::endl;
74
+ v = X<9 >(); std::cout << " move(v) as X< 9> = " + cpp2::to_string (int (cpp2::as_<X<9 >>((std::move (v))))) << std::endl;
75
75
v = X<10 >(); std::cout << " move(v) as X<10> = " + cpp2::to_string (int (cpp2::as_<X<10 >>((std::move (v))))) << std::endl;
76
76
v = X<11 >(); std::cout << " move(v) as X<11> = " + cpp2::to_string (int (cpp2::as_<X<11 >>((std::move (v))))) << std::endl;
77
77
v = X<12 >(); std::cout << " move(v) as X<12> = " + cpp2::to_string (int (cpp2::as_<X<12 >>((std::move (v))))) << std::endl;
0 commit comments