Lines Matching refs:Optional
175 static_assert(std::is_trivially_destructible<Optional<int>>::value,
179 !std::is_trivially_destructible<Optional<NonTriviallyDestructible>>::value,
182 static_assert(sizeof(Optional<int>) == sizeof(internal::OptionalBase<int>),
188 constexpr Optional<float> o; in TEST()
193 Optional<std::string> o; in TEST()
198 Optional<TestObject> o; in TEST()
205 constexpr Optional<float> first(0.1f); in TEST()
206 constexpr Optional<float> other(first); in TEST()
214 Optional<std::string> first("foo"); in TEST()
215 Optional<std::string> other(first); in TEST()
223 const Optional<std::string> first("foo"); in TEST()
224 Optional<std::string> other(first); in TEST()
232 Optional<TestObject> first(TestObject(3, 0.1)); in TEST()
233 Optional<TestObject> other(first); in TEST()
244 constexpr Optional<float> o(value); in TEST()
252 Optional<std::string> o(value); in TEST()
260 Optional<TestObject> o(value); in TEST()
270 constexpr Optional<float> first(0.1f); in TEST()
271 constexpr Optional<float> second(std::move(first)); in TEST()
280 Optional<std::string> first("foo"); in TEST()
281 Optional<std::string> second(std::move(first)); in TEST()
290 Optional<TestObject> first(TestObject(3, 0.1)); in TEST()
291 Optional<TestObject> second(std::move(first)); in TEST()
304 Optional<DeletedCopy> first(in_place, 42); in TEST()
305 Optional<DeletedCopy> second(std::move(first)); in TEST()
314 Optional<DeletedMove> first(in_place, 42); in TEST()
315 Optional<DeletedMove> second(std::move(first)); in TEST()
324 Optional<NonTriviallyDestructibleDeletedCopyConstructor> first(in_place, in TEST()
326 Optional<NonTriviallyDestructibleDeletedCopyConstructor> second( in TEST()
339 constexpr Optional<float> o(std::move(value)); in TEST()
347 Optional<float> o(std::move(value)); in TEST()
355 Optional<std::string> o(std::move(value)); in TEST()
363 Optional<TestObject> o(std::move(value)); in TEST()
373 Optional<int> first(1); in TEST()
374 Optional<double> second(first); in TEST()
381 Optional<int> o(1); in TEST()
382 ignore_result<Optional<double>>(o); in TEST()
388 Optional<int> first(1); in TEST()
389 Optional<double> second(std::move(first)); in TEST()
396 Optional<int> o(1); in TEST()
397 ignore_result<Optional<double>>(std::move(o)); in TEST()
423 Optional<Test1> first(in_place, 42); in TEST()
424 Optional<Test2> second(std::move(first)); in TEST()
432 constexpr Optional<float> a(base::in_place, 0.1f); in TEST()
438 Optional<float> a(base::in_place, 0.1f); in TEST()
444 Optional<std::string> a(base::in_place, "foo"); in TEST()
450 Optional<TestObject> a(base::in_place, 0, 0.1); in TEST()
458 Optional<std::vector<int>> opt(in_place, {3, 1}); in TEST()
465 Optional<std::vector<int>> opt(in_place, {3, 1}, std::allocator<int>()); in TEST()
474 Optional<double> a(1); in TEST()
487 Optional<TestData> a({1, 2.0, true}); in TEST()
512 explicit Test(Optional<int> param) in TEST()
520 const Optional<int> arg(in_place, 1); in TEST()
521 Optional<Test> testee(arg); in TEST()
527 Optional<Test> testee(Optional<int>(in_place, 1)); in TEST()
533 Optional<Test> testee(in_place); in TEST()
545 ([](Optional<Test> param) {})(1); in TEST()
550 constexpr Optional<int> a(base::nullopt); in TEST()
556 Optional<float> a; in TEST()
561 Optional<float> b(0.1f); in TEST()
566 Optional<std::string> a; in TEST()
571 Optional<std::string> b(std::string("foo")); in TEST()
576 Optional<TestObject> a; in TEST()
581 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
586 Optional<TestObject> a = TestObject(4, 1.0); in TEST()
591 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
598 Optional<float> a; in TEST()
599 Optional<float> b(0.1f); in TEST()
608 Optional<std::string> a; in TEST()
609 Optional<std::string> b("foo"); in TEST()
618 Optional<TestObject> a; in TEST()
619 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
628 Optional<TestObject> a(TestObject(4, 1.0)); in TEST()
629 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
638 Optional<DeletedMove> a(in_place, 42); in TEST()
639 Optional<DeletedMove> b; in TEST()
648 Optional<DeletedMove> a(in_place, 42); in TEST()
649 Optional<DeletedMove> b(in_place, 1); in TEST()
659 Optional<int> a(in_place, 1); in TEST()
660 Optional<double> b; in TEST()
670 Optional<int> a(in_place, 42); in TEST()
671 Optional<double> b(in_place, 1); in TEST()
681 Optional<int> a; in TEST()
682 Optional<double> b(in_place, 1); in TEST()
691 Optional<float> a; in TEST()
692 Optional<float> b(0.1f); in TEST()
701 Optional<std::string> a; in TEST()
702 Optional<std::string> b("foo"); in TEST()
711 Optional<TestObject> a; in TEST()
712 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
724 Optional<TestObject> a(TestObject(4, 1.0)); in TEST()
725 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
737 Optional<DeletedMove> a(in_place, 42); in TEST()
738 Optional<DeletedMove> b; in TEST()
747 Optional<DeletedMove> a(in_place, 42); in TEST()
748 Optional<DeletedMove> b(in_place, 1); in TEST()
758 Optional<int> a(in_place, 1); in TEST()
759 Optional<double> b; in TEST()
768 Optional<int> a(in_place, 42); in TEST()
769 Optional<double> b(in_place, 1); in TEST()
778 Optional<int> a; in TEST()
779 Optional<double> b(in_place, 1); in TEST()
789 Optional<float> a(0.1f); in TEST()
790 Optional<float> b(0.2f); in TEST()
797 Optional<std::string> a("foo"); in TEST()
798 Optional<std::string> b("bar"); in TEST()
805 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
806 Optional<TestObject> b(TestObject(4, 1.0)); in TEST()
853 Optional<Test1> a(in_place); in TEST()
854 Optional<Test2> b; in TEST()
864 Optional<Test1> a(in_place); in TEST()
865 Optional<Test2> b(in_place); in TEST()
875 Optional<Test1> a(in_place); in TEST()
876 Optional<Test2> b; in TEST()
886 Optional<Test1> a(in_place); in TEST()
887 Optional<Test2> b(in_place); in TEST()
920 explicit Test3(const Optional<Test1>& test1) in TEST()
922 explicit Test3(Optional<Test1>&& test1) in TEST()
937 Test3& operator=(const Optional<Test1>& test1) { in TEST()
941 Test3& operator=(Optional<Test1>&& test1) { in TEST()
953 Optional<Test1> a(in_place); in TEST()
954 Optional<Test3> b; in TEST()
964 Optional<Test1> a(in_place); in TEST()
965 Optional<Test3> b(in_place); in TEST()
975 Optional<Test1> a(in_place); in TEST()
976 Optional<Test3> b; in TEST()
986 Optional<Test1> a(in_place); in TEST()
987 Optional<Test3> b(in_place); in TEST()
999 Optional<float> a(0.1f); in TEST()
1004 Optional<std::string> a("foo"); in TEST()
1009 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1015 EXPECT_EQ(0.1f, *Optional<float>(0.1f)); in TEST()
1016 EXPECT_EQ(std::string("foo"), *Optional<std::string>("foo")); in TEST()
1017 EXPECT_TRUE(TestObject(3, 0.1) == *Optional<TestObject>(TestObject(3, 0.1))); in TEST()
1021 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1026 EXPECT_EQ(0.1f, Optional<float>(0.1f).value()); in TEST()
1027 EXPECT_EQ(std::string("foo"), Optional<std::string>("foo").value()); in TEST()
1029 Optional<TestObject>(TestObject(3, 0.1)).value()); in TEST()
1034 Optional<float> a; in TEST()
1046 constexpr Optional<int> a(in_place, 1); in TEST()
1051 constexpr Optional<int> a; in TEST()
1057 Optional<std::string> a; in TEST()
1068 Optional<TestObject> a; in TEST()
1080 Optional<TestObject> a, b; in TEST()
1090 Optional<TestObject> a(TestObject(1, 0.3)); in TEST()
1091 Optional<TestObject> b; in TEST()
1102 Optional<TestObject> a; in TEST()
1103 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
1113 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
1114 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
1127 Optional<float> a(0.1f); in TEST()
1135 Optional<std::string> a("foo"); in TEST()
1143 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
1151 Optional<std::vector<int>> a; in TEST()
1160 Optional<std::vector<int>> a; in TEST()
1170 Optional<int> a; in TEST()
1171 Optional<int> b; in TEST()
1177 Optional<int> a(1); in TEST()
1178 Optional<int> b(1); in TEST()
1184 Optional<int> a; in TEST()
1185 Optional<int> b(1); in TEST()
1191 Optional<int> a(0); in TEST()
1192 Optional<int> b(1); in TEST()
1198 Optional<int> a(0); in TEST()
1199 Optional<double> b(0); in TEST()
1205 Optional<int> a; in TEST()
1206 Optional<int> b; in TEST()
1212 Optional<int> a(1); in TEST()
1213 Optional<int> b(1); in TEST()
1219 Optional<int> a; in TEST()
1220 Optional<int> b(1); in TEST()
1226 Optional<int> a(0); in TEST()
1227 Optional<int> b(1); in TEST()
1233 Optional<int> a(0); in TEST()
1234 Optional<double> b(0.0); in TEST()
1240 Optional<int> l; in TEST()
1241 Optional<int> r(1); in TEST()
1247 Optional<int> l(1); in TEST()
1248 Optional<int> r; in TEST()
1254 Optional<int> l; in TEST()
1255 Optional<int> r; in TEST()
1262 Optional<int> l(1); in TEST()
1263 Optional<int> r(2); in TEST()
1268 Optional<int> l(2); in TEST()
1269 Optional<int> r(1); in TEST()
1274 Optional<int> l(1); in TEST()
1275 Optional<int> r(1); in TEST()
1282 Optional<int> l(1); in TEST()
1283 Optional<double> r(2.0); in TEST()
1289 Optional<int> l; in TEST()
1290 Optional<int> r(1); in TEST()
1296 Optional<int> l(1); in TEST()
1297 Optional<int> r; in TEST()
1303 Optional<int> l; in TEST()
1304 Optional<int> r; in TEST()
1311 Optional<int> l(1); in TEST()
1312 Optional<int> r(2); in TEST()
1317 Optional<int> l(2); in TEST()
1318 Optional<int> r(1); in TEST()
1323 Optional<int> l(1); in TEST()
1324 Optional<int> r(1); in TEST()
1331 Optional<int> l(1); in TEST()
1332 Optional<double> r(2.0); in TEST()
1338 Optional<int> l; in TEST()
1339 Optional<int> r; in TEST()
1345 Optional<int> l; in TEST()
1346 Optional<int> r(1); in TEST()
1352 Optional<int> l(1); in TEST()
1353 Optional<int> r; in TEST()
1360 Optional<int> l(1); in TEST()
1361 Optional<int> r(2); in TEST()
1366 Optional<int> l(2); in TEST()
1367 Optional<int> r(1); in TEST()
1372 Optional<int> l(1); in TEST()
1373 Optional<int> r(1); in TEST()
1380 Optional<int> l(1); in TEST()
1381 Optional<double> r(2.0); in TEST()
1387 Optional<int> l; in TEST()
1388 Optional<int> r; in TEST()
1394 Optional<int> l; in TEST()
1395 Optional<int> r(1); in TEST()
1401 Optional<int> l(1); in TEST()
1402 Optional<int> r; in TEST()
1409 Optional<int> l(1); in TEST()
1410 Optional<int> r(2); in TEST()
1415 Optional<int> l(2); in TEST()
1416 Optional<int> r(1); in TEST()
1421 Optional<int> l(1); in TEST()
1422 Optional<int> r(1); in TEST()
1429 Optional<int> l(1); in TEST()
1430 Optional<double> r(2.0); in TEST()
1437 Optional<int> opt; in TEST()
1441 Optional<int> opt(1); in TEST()
1448 Optional<int> opt; in TEST()
1452 Optional<int> opt(1); in TEST()
1459 Optional<int> opt; in TEST()
1463 Optional<int> opt(1); in TEST()
1470 Optional<int> opt; in TEST()
1474 Optional<int> opt(1); in TEST()
1481 Optional<int> opt; in TEST()
1485 Optional<int> opt(1); in TEST()
1492 Optional<int> opt; in TEST()
1496 Optional<int> opt(1); in TEST()
1503 Optional<int> opt; in TEST()
1507 Optional<int> opt(1); in TEST()
1514 Optional<int> opt; in TEST()
1518 Optional<int> opt(1); in TEST()
1525 Optional<int> opt; in TEST()
1529 Optional<int> opt(1); in TEST()
1536 Optional<int> opt; in TEST()
1540 Optional<int> opt(1); in TEST()
1547 Optional<int> opt; in TEST()
1551 Optional<int> opt(1); in TEST()
1558 Optional<int> opt; in TEST()
1562 Optional<int> opt(1); in TEST()
1568 Optional<int> opt; in TEST()
1574 Optional<int> opt(0); in TEST()
1578 Optional<int> opt(1); in TEST()
1584 Optional<int> opt(0); in TEST()
1589 Optional<int> opt; in TEST()
1595 Optional<int> opt(0); in TEST()
1599 Optional<int> opt(1); in TEST()
1605 Optional<int> opt(0); in TEST()
1610 Optional<int> opt; in TEST()
1616 Optional<int> opt(0); in TEST()
1620 Optional<int> opt(1); in TEST()
1626 Optional<int> opt(0); in TEST()
1631 Optional<int> opt; in TEST()
1637 Optional<int> opt(0); in TEST()
1641 Optional<int> opt(1); in TEST()
1647 Optional<int> opt(0); in TEST()
1652 Optional<int> opt; in TEST()
1658 Optional<int> opt(0); in TEST()
1662 Optional<int> opt(1); in TEST()
1666 Optional<int> opt(2); in TEST()
1672 Optional<int> opt(0); in TEST()
1677 Optional<int> opt; in TEST()
1683 Optional<int> opt(0); in TEST()
1687 Optional<int> opt(1); in TEST()
1691 Optional<int> opt(2); in TEST()
1697 Optional<int> opt(0); in TEST()
1702 Optional<int> opt; in TEST()
1708 Optional<int> opt(0); in TEST()
1712 Optional<int> opt(1); in TEST()
1716 Optional<int> opt(2); in TEST()
1722 Optional<int> opt(0); in TEST()
1727 Optional<int> opt; in TEST()
1733 Optional<int> opt(0); in TEST()
1737 Optional<int> opt(1); in TEST()
1741 Optional<int> opt(2); in TEST()
1747 Optional<int> opt(0); in TEST()
1752 Optional<int> opt; in TEST()
1758 Optional<int> opt(0); in TEST()
1762 Optional<int> opt(1); in TEST()
1766 Optional<int> opt(2); in TEST()
1772 Optional<int> opt(0); in TEST()
1777 Optional<int> opt; in TEST()
1783 Optional<int> opt(0); in TEST()
1787 Optional<int> opt(1); in TEST()
1791 Optional<int> opt(2); in TEST()
1797 Optional<int> opt(0); in TEST()
1802 Optional<int> opt; in TEST()
1808 Optional<int> opt(0); in TEST()
1812 Optional<int> opt(1); in TEST()
1816 Optional<int> opt(2); in TEST()
1822 Optional<int> opt(0); in TEST()
1827 Optional<int> opt; in TEST()
1833 Optional<int> opt(0); in TEST()
1837 Optional<int> opt(1); in TEST()
1841 Optional<int> opt(2); in TEST()
1847 Optional<int> opt(0); in TEST()
1853 Optional<float> a(0.1f); in TEST()
1854 Optional<float> b(0.2f); in TEST()
1859 Optional<std::string> a("foo"); in TEST()
1860 Optional<std::string> b("bar"); in TEST()
1865 Optional<int> a(1); in TEST()
1866 Optional<double> b(2); in TEST()
1871 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1872 Optional<TestObject> b(TestObject(4, 1.0)); in TEST()
1879 Optional<float> a(0.1f); in TEST()
1880 Optional<float> b(0.1f); in TEST()
1886 Optional<std::string> a("foo"); in TEST()
1887 Optional<std::string> b("foo"); in TEST()
1893 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1894 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
1907 Optional<float> o = base::make_optional(32.f); in TEST()
1918 Optional<std::string> o = base::make_optional(std::string("foo")); in TEST()
1929 Optional<TestObject> o = base::make_optional(TestObject(3, 0.1)); in TEST()
1953 Optional<Test> o = base::make_optional<Test>(1, 2.0, true); in TEST()
1971 Optional<TestObject> a, b; in TEST()
1981 Optional<TestObject> a(TestObject(1, 0.3)); in TEST()
1982 Optional<TestObject> b; in TEST()
1992 Optional<TestObject> a; in TEST()
1993 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
2003 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
2004 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
2018 std::hash<Optional<int>> opt_int_hash; in TEST()
2020 EXPECT_EQ(int_hash(1), opt_int_hash(Optional<int>(1))); in TEST()
2025 std::hash<Optional<std::string>> opt_str_hash; in TEST()
2028 opt_str_hash(Optional<std::string>(std::string("foobar")))); in TEST()
2033 std::hash<Optional<int>> opt_int_hash; in TEST()
2034 std::hash<Optional<std::string>> opt_str_hash; in TEST()
2036 EXPECT_EQ(opt_str_hash(Optional<std::string>()), in TEST()
2037 opt_int_hash(Optional<int>())); in TEST()
2041 std::set<Optional<int>> setOptInt; in TEST()
2045 setOptInt.insert(Optional<int>(3)); in TEST()
2051 Optional<int> a; in TEST()
2063 a = Optional<int>(); in TEST()
2068 Optional<int> a(0); in TEST()
2078 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
2088 Optional<int> a; in TEST()
2096 Optional<TestObject> a; in TEST()
2106 Optional<DeletedDefaultConstructor> a; in TEST()
2115 Optional<DeleteNewOperators> a; in TEST()
2152 noexcept(Optional<int>(std::declval<Optional<int>>())), in TEST()
2156 !noexcept(Optional<Test1>(std::declval<Optional<Test1>>())), in TEST()
2160 noexcept(Optional<Test2>(std::declval<Optional<Test2>>())), in TEST()
2164 noexcept(Optional<Test3>(std::declval<Optional<Test3>>())), in TEST()
2168 noexcept(Optional<Test4>(std::declval<Optional<Test4>>())), in TEST()
2172 !noexcept(Optional<Test5>(std::declval<Optional<Test5>>())), in TEST()
2177 noexcept(std::declval<Optional<int>>() = std::declval<Optional<int>>()), in TEST()
2181 !noexcept(std::declval<Optional<Test1>>() = in TEST()
2182 std::declval<Optional<Test1>>()), in TEST()
2185 !noexcept(std::declval<Optional<Test2>>() = in TEST()
2186 std::declval<Optional<Test2>>()), in TEST()