Lines Matching refs:opt1
68 optional<int> opt1;
70 static_assert(noexcept(swap(opt1, opt2)) == true, "");
71 assert(static_cast<bool>(opt1) == false);
73 swap(opt1, opt2);
74 assert(static_cast<bool>(opt1) == false);
78 optional<int> opt1(1);
80 static_assert(noexcept(swap(opt1, opt2)) == true, "");
81 assert(static_cast<bool>(opt1) == true);
82 assert(*opt1 == 1);
84 swap(opt1, opt2);
85 assert(static_cast<bool>(opt1) == false);
90 optional<int> opt1;
92 static_assert(noexcept(swap(opt1, opt2)) == true, "");
93 assert(static_cast<bool>(opt1) == false);
96 swap(opt1, opt2);
97 assert(static_cast<bool>(opt1) == true);
98 assert(*opt1 == 2);
102 optional<int> opt1(1);
104 static_assert(noexcept(swap(opt1, opt2)) == true, "");
105 assert(static_cast<bool>(opt1) == true);
106 assert(*opt1 == 1);
109 swap(opt1, opt2);
110 assert(static_cast<bool>(opt1) == true);
111 assert(*opt1 == 2);
116 optional<X> opt1;
118 static_assert(noexcept(swap(opt1, opt2)) == true, "");
119 assert(static_cast<bool>(opt1) == false);
121 swap(opt1, opt2);
122 assert(static_cast<bool>(opt1) == false);
127 optional<X> opt1(1);
129 static_assert(noexcept(swap(opt1, opt2)) == true, "");
130 assert(static_cast<bool>(opt1) == true);
131 assert(*opt1 == 1);
134 swap(opt1, opt2);
136 assert(static_cast<bool>(opt1) == false);
141 optional<X> opt1;
143 static_assert(noexcept(swap(opt1, opt2)) == true, "");
144 assert(static_cast<bool>(opt1) == false);
148 swap(opt1, opt2);
150 assert(static_cast<bool>(opt1) == true);
151 assert(*opt1 == 2);
155 optional<X> opt1(1);
157 static_assert(noexcept(swap(opt1, opt2)) == true, "");
158 assert(static_cast<bool>(opt1) == true);
159 assert(*opt1 == 1);
163 swap(opt1, opt2);
165 assert(static_cast<bool>(opt1) == true);
166 assert(*opt1 == 2);
171 optional<Y> opt1;
173 static_assert(noexcept(swap(opt1, opt2)) == false, "");
174 assert(static_cast<bool>(opt1) == false);
176 swap(opt1, opt2);
177 assert(static_cast<bool>(opt1) == false);
182 optional<Y> opt1(1);
184 static_assert(noexcept(swap(opt1, opt2)) == false, "");
185 assert(static_cast<bool>(opt1) == true);
186 assert(*opt1 == 1);
189 swap(opt1, opt2);
191 assert(static_cast<bool>(opt1) == false);
196 optional<Y> opt1;
198 static_assert(noexcept(swap(opt1, opt2)) == false, "");
199 assert(static_cast<bool>(opt1) == false);
203 swap(opt1, opt2);
205 assert(static_cast<bool>(opt1) == true);
206 assert(*opt1 == 2);
210 optional<Y> opt1(1);
212 static_assert(noexcept(swap(opt1, opt2)) == false, "");
213 assert(static_cast<bool>(opt1) == true);
214 assert(*opt1 == 1);
218 swap(opt1, opt2);
220 assert(static_cast<bool>(opt1) == true);
221 assert(*opt1 == 2);
226 optional<Z> opt1;
228 static_assert(noexcept(swap(opt1, opt2)) == false, "");
229 assert(static_cast<bool>(opt1) == false);
231 swap(opt1, opt2);
232 assert(static_cast<bool>(opt1) == false);
237 optional<Z> opt1;
238 opt1.emplace(1);
240 static_assert(noexcept(swap(opt1, opt2)) == false, "");
241 assert(static_cast<bool>(opt1) == true);
242 assert(*opt1 == 1);
246 swap(opt1, opt2);
253 assert(static_cast<bool>(opt1) == true);
254 assert(*opt1 == 1);
258 optional<Z> opt1;
261 static_assert(noexcept(swap(opt1, opt2)) == false, "");
262 assert(static_cast<bool>(opt1) == false);
267 swap(opt1, opt2);
274 assert(static_cast<bool>(opt1) == false);
279 optional<Z> opt1;
280 opt1.emplace(1);
283 static_assert(noexcept(swap(opt1, opt2)) == false, "");
284 assert(static_cast<bool>(opt1) == true);
285 assert(*opt1 == 1);
290 swap(opt1, opt2);
297 assert(static_cast<bool>(opt1) == true);
298 assert(*opt1 == 1);