@@ -19,24 +19,29 @@ class outer;
19
19
#line 4 "pure2-print.cpp2"
20
20
class outer {
21
21
22
+ public: template <typename T>
23
+ CPP2_REQUIRES_ (true )
24
+ #line 6 "pure2-print.cpp2"
25
+ T static constexpr object_alias = 42 ;
26
+
22
27
public: class mytype final
23
28
{
24
29
protected: [[nodiscard]] static auto f () -> int;
25
30
26
31
public: [[nodiscard]] virtual auto g (cpp2::in<int > i) const & -> int;
27
32
28
33
29
- #line 27 "pure2-print.cpp2"
34
+ #line 29 "pure2-print.cpp2"
30
35
private: [[nodiscard]] static auto h (cpp2::in<std::string> s, std::map<int const ,std::string>& m) -> std::string;
31
36
struct values__ret { int offset; std::string name; };
32
37
33
38
34
39
35
- #line 50 "pure2-print.cpp2"
40
+ #line 52 "pure2-print.cpp2"
36
41
public: template <typename T> [[nodiscard]] auto values (T const & t) const & -> values__ret;
37
42
38
43
39
- #line 55 "pure2-print.cpp2"
44
+ #line 57 "pure2-print.cpp2"
40
45
public: explicit mytype ();
41
46
42
47
public: mytype([[maybe_unused]] mytype const & that);
@@ -49,31 +54,31 @@ class outer {
49
54
public: static auto test () -> void;
50
55
51
56
52
- #line 75 "pure2-print.cpp2"
57
+ #line 84 "pure2-print.cpp2"
53
58
public: template <typename ...Ts> class x {
54
59
private: std::tuple<Ts...> tup {};
55
60
public: x() = default ;
56
61
public: x(x const &) = delete ; /* No 'that' constructor, suppress copy */
57
62
public: auto operator =(x const &) -> void = delete ;
58
63
59
- #line 77 "pure2-print.cpp2"
64
+ #line 86 "pure2-print.cpp2"
60
65
};
61
66
62
67
public: template <typename ...Args> static auto print (std::ostream& out, Args const & ...args) -> void
63
68
CPP2_REQUIRES_ (cpp2::cmp_greater_eq(sizeof (Args)...,0))
64
- #line 79 "pure2-print.cpp2"
69
+ #line 88 "pure2-print.cpp2"
65
70
;
66
71
67
72
68
- #line 83 "pure2-print.cpp2"
73
+ #line 92 "pure2-print.cpp2"
69
74
public: template <typename ...Args> [[nodiscard]] static auto all (Args const & ...args) -> bool;
70
75
71
76
public: outer() = default ;
72
77
public: outer(outer const &) = delete ; /* No 'that' constructor, suppress copy */
73
78
public: auto operator =(outer const &) -> void = delete ;
74
79
75
80
76
- #line 86 "pure2-print.cpp2"
81
+ #line 95 "pure2-print.cpp2"
77
82
};
78
83
79
84
auto main () -> int;
@@ -82,7 +87,7 @@ auto main() -> int;
82
87
// === Cpp2 function definitions =================================================
83
88
84
89
85
- #line 8 "pure2-print.cpp2"
90
+ #line 10 "pure2-print.cpp2"
86
91
[[nodiscard]] auto outer::mytype::f () -> int { return 42 ; }
87
92
88
93
[[nodiscard]] auto outer::mytype::g (cpp2::in<int > i) const & -> int{
@@ -104,11 +109,11 @@ auto main() -> int;
104
109
105
110
[[nodiscard]] auto outer::mytype::h (cpp2::in<std::string> s, std::map<int const ,std::string>& m) -> std::string
106
111
107
- #line 30 "pure2-print.cpp2"
112
+ #line 32 "pure2-print.cpp2"
108
113
{
109
114
cpp2::Default.expects (CPP2_UFCS_0 (empty, m) == false || false , " " );
110
115
cpp2::Bounds.expects ([_0 = 0 , _1 = CPP2_UFCS_0 (ssize, m), _2 = 100 ]{ return cpp2::cmp_less (_0,_1) && cpp2::cmp_less (_1,_2); }() && true != false , " " );
111
- #line 31 "pure2-print.cpp2"
116
+ #line 33 "pure2-print.cpp2"
112
117
auto a {[]() -> void {}};
113
118
auto b {[]() -> void {}};
114
119
auto c {[]() -> void {}};
@@ -118,10 +123,10 @@ auto main() -> int;
118
123
do {} while ( CPP2_UFCS_0 (empty, s) && [&]{ b () ; return true ; }() );
119
124
120
125
for ( [[maybe_unused]] auto const & param1 : m ) {
121
- #line 39 "pure2-print.cpp2"
122
- { do {goto CONTINUE_39_13; } while (false ); c (); } CPP2_CONTINUE_BREAK (39_13) }
123
-
124
126
#line 41 "pure2-print.cpp2"
127
+ { do {goto CONTINUE_41_13; } while (false ); c (); } CPP2_CONTINUE_BREAK (41_13) }
128
+
129
+ #line 43 "pure2-print.cpp2"
125
130
if (cpp2::is (!(CPP2_UFCS_0 (empty, s)), (true ))) {std::move (a)(); }
126
131
else {if (!(CPP2_UFCS_0 (empty, m))) {std::move (b)(); }
127
132
else {std::move (c)(); }}
@@ -134,7 +139,7 @@ auto main() -> int;
134
139
template <typename T> [[nodiscard]] auto outer::mytype::values (T const & t) const & -> values__ret{
135
140
cpp2::deferred_init<int > offset;
136
141
cpp2::deferred_init<std::string> name;
137
- #line 51 "pure2-print.cpp2"
142
+ #line 53 "pure2-print.cpp2"
138
143
offset.construct (53 );
139
144
name.construct (" plugh" );
140
145
return { std::move (offset.value ()), std::move (name.value ()) }; }
@@ -147,30 +152,37 @@ auto main() -> int;
147
152
148
153
auto outer::mytype::variadic (auto const & ...x) -> void{}
149
154
150
- #line 64 "pure2-print.cpp2"
155
+ #line 66 "pure2-print.cpp2"
151
156
auto outer::test () -> void{
157
+ namespace namespace_alias = ::std;
158
+
159
+ using type_alias = std::array<int ,10 >;
160
+
161
+ cpp2::i8 const & object_alias_1 = 42 ;
162
+ auto const & object_alias_2 = 42 ;
163
+
164
+ #line 75 "pure2-print.cpp2"
152
165
::outer::mytype var {};
153
166
std::cout << CPP2_UFCS (g, var, 42 ) << " \n " ;
154
167
155
- std::cout << [&] () -> std ::string { auto && __expr = CPP2_UFCS (g, std::move (var), 42 );
156
- if (cpp2::is (__expr, 43 )) { if constexpr ( requires{" forty-and-three" ;} ) if constexpr ( std::is_convertible_v<CPP2_TYPEOF ((" forty-and-three" )),std ::string> ) return " forty-and-three" ; else return std ::string{}; else return std ::string{}; }
168
+ std::cout << [&] () -> namespace_alias ::string { auto && __expr = CPP2_UFCS (g, std::move (var), 42 );
169
+ if (cpp2::is (__expr, 43 )) { if constexpr ( requires{" forty-and-three" ;} ) if constexpr ( std::is_convertible_v<CPP2_TYPEOF ((" forty-and-three" )),namespace_alias ::string> ) return " forty-and-three" ; else return namespace_alias ::string{}; else return namespace_alias ::string{}; }
157
170
else return " default case" ; }
158
171
() << " \n " ;
159
-
160
172
}
161
173
162
- #line 79 "pure2-print.cpp2"
174
+ #line 88 "pure2-print.cpp2"
163
175
template <typename ...Args> auto outer::print (std::ostream& out, Args const & ...args) -> void
164
176
requires (cpp2::cmp_greater_eq(sizeof (Args)...,0))
165
- #line 79 "pure2-print.cpp2"
177
+ #line 88 "pure2-print.cpp2"
166
178
{
167
179
(out << ... << args);
168
180
}
169
181
170
182
template <typename ...Args> [[nodiscard]] auto outer::all (Args const & ...args) -> bool {
171
183
return (... && args); }
172
184
173
- #line 88 "pure2-print.cpp2"
185
+ #line 97 "pure2-print.cpp2"
174
186
auto main () -> int{
175
187
outer::test ();
176
188
}
0 commit comments