Lines Matching refs:opt

89         optional<T> opt;  in test_with_test_type()  local
90 opt = 3; in test_with_test_type()
96 assert(static_cast<bool>(opt) == true); in test_with_test_type()
97 assert(*opt == T(3)); in test_with_test_type()
100 optional<T> opt(42); in test_with_test_type() local
102 opt = 3; in test_with_test_type()
108 assert(static_cast<bool>(opt) == true); in test_with_test_type()
109 assert(*opt == T(3)); in test_with_test_type()
112 optional<T> opt; in test_with_test_type() local
114 opt = {1, 2}; in test_with_test_type()
121 assert(static_cast<bool>(opt) == true); in test_with_test_type()
122 assert(*opt == T(1, 2)); in test_with_test_type()
125 optional<T> opt(42); in test_with_test_type() local
127 opt = {1, 2}; in test_with_test_type()
134 assert(static_cast<bool>(opt) == true); in test_with_test_type()
135 assert(*opt == T(1, 2)); in test_with_test_type()
138 optional<T> opt; in test_with_test_type() local
140 opt = {1}; in test_with_test_type()
147 assert(static_cast<bool>(opt) == true); in test_with_test_type()
148 assert(*opt == T(1)); in test_with_test_type()
151 optional<T> opt(42); in test_with_test_type() local
153 opt = {}; in test_with_test_type()
154 assert(static_cast<bool>(opt) == false); in test_with_test_type()
165 optional<T> opt; in test_with_type() local
166 opt = Value(3); in test_with_type()
167 assert(static_cast<bool>(opt) == true); in test_with_type()
168 assert(*opt == T(3)); in test_with_type()
171 optional<T> opt(Value(42)); in test_with_type() local
172 opt = Value(3); in test_with_type()
173 assert(static_cast<bool>(opt) == true); in test_with_type()
174 assert(*opt == T(3)); in test_with_type()
177 optional<T> opt(Value(42)); in test_with_type() local
179 opt = t; in test_with_type()
180 assert(static_cast<bool>(opt) == true); in test_with_type()
181 assert(*opt == T(3)); in test_with_type()
184 optional<T> opt; in test_with_type() local
185 opt = {Value(1)}; in test_with_type()
186 assert(static_cast<bool>(opt) == true); in test_with_type()
187 assert(*opt == T(1)); in test_with_type()
190 optional<T> opt(Value(42)); in test_with_type() local
191 opt = {}; in test_with_type()
192 assert(static_cast<bool>(opt) == false); in test_with_type()
200 optional<T> opt; in test_with_type_multi() local
201 opt = {1, 2}; in test_with_type_multi()
202 assert(static_cast<bool>(opt) == true); in test_with_type_multi()
203 assert(*opt == T(1, 2)); in test_with_type_multi()
206 optional<T> opt(42); in test_with_type_multi() local
207 opt = {1, 2}; in test_with_type_multi()
208 assert(static_cast<bool>(opt) == true); in test_with_type_multi()
209 assert(*opt == T(1, 2)); in test_with_type_multi()
218 optional<T> opt; in test_throws() local
220 opt = 42; in test_throws()
223 assert(static_cast<bool>(opt) == false); in test_throws()
228 optional<T> opt(std::in_place); in test_throws() local
230 opt = 42; in test_throws()
233 assert(static_cast<bool>(opt) == true); in test_throws()
269 optional<std::unique_ptr<int>> opt; in main() local
270 opt = std::unique_ptr<int>(new int(3)); in main()
271 assert(static_cast<bool>(opt) == true); in main()
272 assert(**opt == 3); in main()
275 optional<std::unique_ptr<int>> opt(std::unique_ptr<int>(new int(2))); in main()
276 opt = std::unique_ptr<int>(new int(3)); in main()
277 assert(static_cast<bool>(opt) == true); in main()
278 assert(**opt == 3); in main()