Home | History | Annotate | Download | only in optional.object.swap

Lines Matching refs:opt2

73         optional<int> opt2;
74 static_assert(noexcept(opt1.swap(opt2)) == true, "");
76 assert(static_cast<bool>(opt2) == false);
77 opt1.swap(opt2);
79 assert(static_cast<bool>(opt2) == false);
83 optional<int> opt2;
84 static_assert(noexcept(opt1.swap(opt2)) == true, "");
87 assert(static_cast<bool>(opt2) == false);
88 opt1.swap(opt2);
90 assert(static_cast<bool>(opt2) == true);
91 assert(*opt2 == 1);
95 optional<int> opt2(2);
96 static_assert(noexcept(opt1.swap(opt2)) == true, "");
98 assert(static_cast<bool>(opt2) == true);
99 assert(*opt2 == 2);
100 opt1.swap(opt2);
103 assert(static_cast<bool>(opt2) == false);
107 optional<int> opt2(2);
108 static_assert(noexcept(opt1.swap(opt2)) == true, "");
111 assert(static_cast<bool>(opt2) == true);
112 assert(*opt2 == 2);
113 opt1.swap(opt2);
116 assert(static_cast<bool>(opt2) == true);
117 assert(*opt2 == 1);
121 optional<X> opt2;
122 static_assert(noexcept(opt1.swap(opt2)) == true, "");
124 assert(static_cast<bool>(opt2) == false);
125 opt1.swap(opt2);
127 assert(static_cast<bool>(opt2) == false);
132 optional<X> opt2;
133 static_assert(noexcept(opt1.swap(opt2)) == true, "");
136 assert(static_cast<bool>(opt2) == false);
138 opt1.swap(opt2);
141 assert(static_cast<bool>(opt2) == true);
142 assert(*opt2 == 1);
146 optional<X> opt2(2);
147 static_assert(noexcept(opt1.swap(opt2)) == true, "");
149 assert(static_cast<bool>(opt2) == true);
150 assert(*opt2 == 2);
152 opt1.swap(opt2);
156 assert(static_cast<bool>(opt2) == false);
160 optional<X> opt2(2);
161 static_assert(noexcept(opt1.swap(opt2)) == true, "");
164 assert(static_cast<bool>(opt2) == true);
165 assert(*opt2 == 2);
167 opt1.swap(opt2);
171 assert(static_cast<bool>(opt2) == true);
172 assert(*opt2 == 1);
176 optional<Y> opt2;
177 static_assert(noexcept(opt1.swap(opt2)) == false, "");
179 assert(static_cast<bool>(opt2) == false);
180 opt1.swap(opt2);
182 assert(static_cast<bool>(opt2) == false);
187 optional<Y> opt2;
188 static_assert(noexcept(opt1.swap(opt2)) == false, "");
191 assert(static_cast<bool>(opt2) == false);
193 opt1.swap(opt2);
196 assert(static_cast<bool>(opt2) == true);
197 assert(*opt2 == 1);
201 optional<Y> opt2(2);
202 static_assert(noexcept(opt1.swap(opt2)) == false, "");
204 assert(static_cast<bool>(opt2) == true);
205 assert(*opt2 == 2);
207 opt1.swap(opt2);
211 assert(static_cast<bool>(opt2) == false);
215 optional<Y> opt2(2);
216 static_assert(noexcept(opt1.swap(opt2)) == false, "");
219 assert(static_cast<bool>(opt2) == true);
220 assert(*opt2 == 2);
222 opt1.swap(opt2);
226 assert(static_cast<bool>(opt2) == true);
227 assert(*opt2 == 1);
231 optional<Z> opt2;
232 static_assert(noexcept(opt1.swap(opt2)) == false, "");
234 assert(static_cast<bool>(opt2) == false);
235 opt1.swap(opt2);
237 assert(static_cast<bool>(opt2) == false);
242 optional<Z> opt2;
243 static_assert(noexcept(opt1.swap(opt2)) == false, "");
246 assert(static_cast<bool>(opt2) == false);
249 opt1.swap(opt2);
258 assert(static_cast<bool>(opt2) == false);
262 optional<Z> opt2;
263 opt2.emplace(2);
264 static_assert(noexcept(opt1.swap(opt2)) == false, "");
266 assert(static_cast<bool>(opt2) == true);
267 assert(*opt2 == 2);
270 opt1.swap(opt2);
278 assert(static_cast<bool>(opt2) == true);
279 assert(*opt2 == 2);
284 optional<Z> opt2;
285 opt2.emplace(2);
286 static_assert(noexcept(opt1.swap(opt2)) == false, "");
289 assert(static_cast<bool>(opt2) == true);
290 assert(*opt2 == 2);
293 opt1.swap(opt2);
302 assert(static_cast<bool>(opt2) == true);
303 assert(*opt2 == 2);