@@ -31,17 +31,17 @@ CPP2_REQUIRES_ (true)
31
31
public: [[nodiscard]] virtual auto g (cpp2::in<int > i) const -> int;
32
32
33
33
34
- #line 29 "pure2-print.cpp2"
34
+ #line 31 "pure2-print.cpp2"
35
35
private: [[nodiscard]] static auto h (cpp2::in<std::string> s, std::map<int const ,std::string>& m) -> std::string;
36
36
struct values_ret { int offset; std::string name; };
37
37
38
38
39
39
40
- #line 52 "pure2-print.cpp2"
40
+ #line 54 "pure2-print.cpp2"
41
41
public: template <typename T> [[nodiscard]] auto values ([[maybe_unused]] T const & param2) const & -> values_ret;
42
42
43
43
44
- #line 57 "pure2-print.cpp2"
44
+ #line 59 "pure2-print.cpp2"
45
45
public: explicit mytype ();
46
46
47
47
public: mytype([[maybe_unused]] mytype const & that);
@@ -50,38 +50,38 @@ CPP2_REQUIRES_ (true)
50
50
51
51
public: static auto variadic (auto const & ...x) -> void
52
52
CPP2_REQUIRES_ ((std::is_convertible_v<CPP2_TYPEOF(x), int> && ...))
53
- #line 63 "pure2-print.cpp2"
53
+ #line 65 "pure2-print.cpp2"
54
54
;
55
55
};
56
56
57
57
public: static auto test () -> void;
58
58
59
59
60
- #line 84 "pure2-print.cpp2"
60
+ #line 89 "pure2-print.cpp2"
61
61
public: template <typename ...Ts> class x {
62
62
private: std::tuple<Ts...> tup {};
63
63
public: x() = default ;
64
64
public: x(x const &) = delete ; /* No 'that' constructor, suppress copy */
65
65
public: auto operator =(x const &) -> void = delete ;
66
66
67
- #line 86 "pure2-print.cpp2"
67
+ #line 91 "pure2-print.cpp2"
68
68
};
69
69
70
70
public: template <typename ...Args> static auto print (std::ostream& out, Args const & ...args) -> void
71
71
CPP2_REQUIRES_ (cpp2::cmp_greater_eq(sizeof (Args)...,0))
72
- #line 88 "pure2-print.cpp2"
72
+ #line 93 "pure2-print.cpp2"
73
73
;
74
74
75
75
76
- #line 92 "pure2-print.cpp2"
76
+ #line 97 "pure2-print.cpp2"
77
77
public: template <typename ...Args> [[nodiscard]] static auto all (Args const & ...args) -> bool;
78
78
79
79
public: outer() = default ;
80
80
public: outer(outer const &) = delete ; /* No 'that' constructor, suppress copy */
81
81
public: auto operator =(outer const &) -> void = delete ;
82
82
83
83
84
- #line 95 "pure2-print.cpp2"
84
+ #line 100 "pure2-print.cpp2"
85
85
};
86
86
87
87
auto main () -> int;
@@ -100,6 +100,8 @@ requires (true)
100
100
[[nodiscard]] auto outer::mytype::f () -> int { return 42 ; }
101
101
102
102
[[nodiscard]] auto outer::mytype::g (cpp2::in<int > i) const -> int{
103
+ using namespace ::std;
104
+
103
105
auto s {" string literal" };
104
106
int ret {i};
105
107
int const * const p {&ret};
@@ -108,8 +110,8 @@ requires (true)
108
110
}
109
111
ret += strlen (s) - 10 + CPP2_UFCS_0 (strlen, std::move (s)) * (16 / (3 & 2 )) % 3 ;
110
112
111
- std:: map<int const ,std:: string> m {};
112
- cpp2::assert_in_bounds (m, 0 ) = cpp2::as_<std:: string>(" har" );
113
+ map<int const ,string> m {};
114
+ cpp2::assert_in_bounds (m, 0 ) = cpp2::as_<string>(" har" );
113
115
ret -= CPP2_UFCS_0 (length, h (" x" , m));
114
116
static_cast <void >(std::move (m));
115
117
@@ -118,11 +120,11 @@ requires (true)
118
120
119
121
[[nodiscard]] auto outer::mytype::h (cpp2::in<std::string> s, std::map<int const ,std::string>& m) -> std::string
120
122
121
- #line 32 "pure2-print.cpp2"
123
+ #line 34 "pure2-print.cpp2"
122
124
{
123
125
cpp2::Default.expects (CPP2_UFCS_0 (empty, m) == false || false , " " );
124
126
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 , " " );
125
- #line 33 "pure2-print.cpp2"
127
+ #line 35 "pure2-print.cpp2"
126
128
auto a {[]() -> void {}};
127
129
auto b {[]() -> void {}};
128
130
auto c {[]() -> void {}};
@@ -132,10 +134,10 @@ requires (true)
132
134
do {} while ( CPP2_UFCS_0 (empty, s) && [&]{ b () ; return true ; }() );
133
135
134
136
for ( [[maybe_unused]] auto const & param1 : m ) {
135
- #line 41 "pure2-print.cpp2"
136
- { do {goto CONTINUE_41_13; } while (false ); c (); } CPP2_CONTINUE_BREAK (41_13) }
137
-
138
137
#line 43 "pure2-print.cpp2"
138
+ { do {goto CONTINUE_43_13; } while (false ); c (); } CPP2_CONTINUE_BREAK (43_13) }
139
+
140
+ #line 45 "pure2-print.cpp2"
139
141
if (cpp2::is (!(CPP2_UFCS_0 (empty, s)), (true ))) {std::move (a)(); }
140
142
else {if (!(CPP2_UFCS_0 (empty, m))) {std::move (b)(); }
141
143
else {std::move (c)(); }}
@@ -148,7 +150,7 @@ requires (true)
148
150
template <typename T> [[nodiscard]] auto outer::mytype::values ([[maybe_unused]] T const & param2) const & -> values_ret{
149
151
cpp2::deferred_init<int > offset;
150
152
cpp2::deferred_init<std::string> name;
151
- #line 53 "pure2-print.cpp2"
153
+ #line 55 "pure2-print.cpp2"
152
154
offset.construct (53 );
153
155
name.construct (" plugh" );
154
156
return { std::move (offset.value ()), std::move (name.value ()) }; }
@@ -161,19 +163,22 @@ requires (true)
161
163
162
164
auto outer::mytype::variadic (auto const & ...x) -> void
163
165
requires ((std::is_convertible_v<CPP2_TYPEOF(x), int> && ...))
164
- #line 63 "pure2-print.cpp2"
166
+ #line 65 "pure2-print.cpp2"
165
167
{(std::cout << ... << x); }
166
168
167
- #line 66 "pure2-print.cpp2"
169
+ #line 68 "pure2-print.cpp2"
168
170
auto outer::test () -> void{
169
171
namespace namespace_alias = ::std;
170
172
173
+ using std::array;
174
+ using std::cout;
175
+
171
176
using type_alias = std::array<int ,10 >;
172
177
173
178
cpp2::i8 constexpr object_alias_1 = 42 ;
174
179
auto constexpr object_alias_2 = 42 ;
175
180
176
- #line 75 "pure2-print.cpp2"
181
+ #line 80 "pure2-print.cpp2"
177
182
::outer::mytype var {};
178
183
std::cout << CPP2_UFCS (g, var, 42 ) << " \n " ;
179
184
@@ -183,18 +188,18 @@ requires ((std::is_convertible_v<CPP2_TYPEOF(x), int> && ...))
183
188
() << " \n " ;
184
189
}
185
190
186
- #line 88 "pure2-print.cpp2"
191
+ #line 93 "pure2-print.cpp2"
187
192
template <typename ...Args> auto outer::print (std::ostream& out, Args const & ...args) -> void
188
193
requires (cpp2::cmp_greater_eq(sizeof (Args)...,0))
189
- #line 88 "pure2-print.cpp2"
194
+ #line 93 "pure2-print.cpp2"
190
195
{
191
196
(out << ... << args);
192
197
}
193
198
194
199
template <typename ...Args> [[nodiscard]] auto outer::all (Args const & ...args) -> bool {
195
200
return (... && args); }
196
201
197
- #line 97 "pure2-print.cpp2"
202
+ #line 102 "pure2-print.cpp2"
198
203
auto main () -> int{
199
204
outer::test ();
200
205
}
0 commit comments