Lines Matching refs:Optional

192 static_assert(std::is_trivially_destructible<Optional<int>>::value,
196 !std::is_trivially_destructible<Optional<NonTriviallyDestructible>>::value,
199 static_assert(sizeof(Optional<int>) == sizeof(internal::OptionalBase<int>),
205 constexpr Optional<float> o; in TEST()
210 Optional<std::string> o; in TEST()
215 Optional<TestObject> o; in TEST()
222 constexpr Optional<float> first(0.1f); in TEST()
223 constexpr Optional<float> other(first); in TEST()
231 Optional<std::string> first("foo"); in TEST()
232 Optional<std::string> other(first); in TEST()
240 const Optional<std::string> first("foo"); in TEST()
241 Optional<std::string> other(first); in TEST()
249 Optional<TestObject> first(TestObject(3, 0.1)); in TEST()
250 Optional<TestObject> other(first); in TEST()
261 constexpr Optional<float> o(value); in TEST()
269 Optional<std::string> o(value); in TEST()
277 Optional<TestObject> o(value); in TEST()
287 constexpr Optional<float> first(0.1f); in TEST()
288 constexpr Optional<float> second(std::move(first)); in TEST()
297 Optional<std::string> first("foo"); in TEST()
298 Optional<std::string> second(std::move(first)); in TEST()
307 Optional<TestObject> first(TestObject(3, 0.1)); in TEST()
308 Optional<TestObject> second(std::move(first)); in TEST()
321 Optional<DeletedCopy> first(in_place, 42); in TEST()
322 Optional<DeletedCopy> second(std::move(first)); in TEST()
331 Optional<DeletedMove> first(in_place, 42); in TEST()
332 Optional<DeletedMove> second(std::move(first)); in TEST()
341 Optional<NonTriviallyDestructibleDeletedCopyConstructor> first(in_place, in TEST()
343 Optional<NonTriviallyDestructibleDeletedCopyConstructor> second( in TEST()
356 constexpr Optional<float> o(std::move(value)); in TEST()
364 Optional<float> o(std::move(value)); in TEST()
372 Optional<std::string> o(std::move(value)); in TEST()
380 Optional<TestObject> o(std::move(value)); in TEST()
390 Optional<int> first(1); in TEST()
391 Optional<double> second(first); in TEST()
398 Optional<int> o(1); in TEST()
399 ignore_result<Optional<double>>(o); in TEST()
405 Optional<int> first(1); in TEST()
406 Optional<double> second(std::move(first)); in TEST()
413 Optional<int> o(1); in TEST()
414 ignore_result<Optional<double>>(std::move(o)); in TEST()
440 Optional<Test1> first(in_place, 42); in TEST()
441 Optional<Test2> second(std::move(first)); in TEST()
449 constexpr Optional<float> a(base::in_place, 0.1f); in TEST()
455 Optional<float> a(base::in_place, 0.1f); in TEST()
461 Optional<std::string> a(base::in_place, "foo"); in TEST()
467 Optional<TestObject> a(base::in_place, 0, 0.1); in TEST()
475 Optional<std::vector<int>> opt(in_place, {3, 1}); in TEST()
482 Optional<std::vector<int>> opt(in_place, {3, 1}, std::allocator<int>()); in TEST()
491 Optional<double> a(1); in TEST()
504 Optional<TestData> a({1, 2.0, true}); in TEST()
529 explicit Test(Optional<int>) : param_type(ParamType::OPTIONAL_INT) {} in TEST()
536 const Optional<int> arg(in_place, 1); in TEST()
537 Optional<Test> testee(arg); in TEST()
543 Optional<Test> testee(Optional<int>(in_place, 1)); in TEST()
549 Optional<Test> testee(in_place); in TEST()
561 ([](Optional<Test>) {})(1); in TEST()
566 constexpr Optional<int> a(base::nullopt); in TEST()
572 Optional<float> a; in TEST()
577 Optional<float> b(0.1f); in TEST()
582 Optional<std::string> a; in TEST()
587 Optional<std::string> b(std::string("foo")); in TEST()
592 Optional<TestObject> a; in TEST()
597 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
602 Optional<TestObject> a = TestObject(4, 1.0); in TEST()
607 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
614 Optional<float> a; in TEST()
615 Optional<float> b(0.1f); in TEST()
624 Optional<std::string> a; in TEST()
625 Optional<std::string> b("foo"); in TEST()
634 Optional<TestObject> a; in TEST()
635 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
644 Optional<TestObject> a(TestObject(4, 1.0)); in TEST()
645 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
654 Optional<DeletedMove> a(in_place, 42); in TEST()
655 Optional<DeletedMove> b; in TEST()
664 Optional<DeletedMove> a(in_place, 42); in TEST()
665 Optional<DeletedMove> b(in_place, 1); in TEST()
675 Optional<int> a(in_place, 1); in TEST()
676 Optional<double> b; in TEST()
686 Optional<int> a(in_place, 42); in TEST()
687 Optional<double> b(in_place, 1); in TEST()
697 Optional<int> a; in TEST()
698 Optional<double> b(in_place, 1); in TEST()
707 Optional<float> a; in TEST()
708 Optional<float> b(0.1f); in TEST()
717 Optional<std::string> a; in TEST()
718 Optional<std::string> b("foo"); in TEST()
727 Optional<TestObject> a; in TEST()
728 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
740 Optional<TestObject> a(TestObject(4, 1.0)); in TEST()
741 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
753 Optional<DeletedMove> a(in_place, 42); in TEST()
754 Optional<DeletedMove> b; in TEST()
763 Optional<DeletedMove> a(in_place, 42); in TEST()
764 Optional<DeletedMove> b(in_place, 1); in TEST()
774 Optional<int> a(in_place, 1); in TEST()
775 Optional<double> b; in TEST()
784 Optional<int> a(in_place, 42); in TEST()
785 Optional<double> b(in_place, 1); in TEST()
794 Optional<int> a; in TEST()
795 Optional<double> b(in_place, 1); in TEST()
805 Optional<float> a(0.1f); in TEST()
806 Optional<float> b(0.2f); in TEST()
813 Optional<std::string> a("foo"); in TEST()
814 Optional<std::string> b("bar"); in TEST()
821 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
822 Optional<TestObject> b(TestObject(4, 1.0)); in TEST()
868 Optional<Test1> a(in_place); in TEST()
869 Optional<Test2> b; in TEST()
879 Optional<Test1> a(in_place); in TEST()
880 Optional<Test2> b(in_place); in TEST()
890 Optional<Test1> a(in_place); in TEST()
891 Optional<Test2> b; in TEST()
901 Optional<Test1> a(in_place); in TEST()
902 Optional<Test2> b(in_place); in TEST()
934 explicit Test3(const Optional<Test1>&) in TEST()
936 explicit Test3(Optional<Test1>&& test1) in TEST()
951 Test3& operator=(const Optional<Test1>&) { in TEST()
955 Test3& operator=(Optional<Test1>&& test1) { in TEST()
967 Optional<Test1> a(in_place); in TEST()
968 Optional<Test3> b; in TEST()
978 Optional<Test1> a(in_place); in TEST()
979 Optional<Test3> b(in_place); in TEST()
989 Optional<Test1> a(in_place); in TEST()
990 Optional<Test3> b; in TEST()
1000 Optional<Test1> a(in_place); in TEST()
1001 Optional<Test3> b(in_place); in TEST()
1013 Optional<float> a(0.1f); in TEST()
1018 Optional<std::string> a("foo"); in TEST()
1023 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1029 EXPECT_EQ(0.1f, *Optional<float>(0.1f)); in TEST()
1030 EXPECT_EQ(std::string("foo"), *Optional<std::string>("foo")); in TEST()
1031 EXPECT_TRUE(TestObject(3, 0.1) == *Optional<TestObject>(TestObject(3, 0.1))); in TEST()
1035 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1040 EXPECT_EQ(0.1f, Optional<float>(0.1f).value()); in TEST()
1041 EXPECT_EQ(std::string("foo"), Optional<std::string>("foo").value()); in TEST()
1043 Optional<TestObject>(TestObject(3, 0.1)).value()); in TEST()
1048 Optional<float> a; in TEST()
1060 constexpr Optional<int> a(in_place, 1); in TEST()
1065 constexpr Optional<int> a; in TEST()
1071 Optional<std::string> a; in TEST()
1082 Optional<TestObject> a; in TEST()
1094 Optional<TestObject> a, b; in TEST()
1104 Optional<TestObject> a(TestObject(1, 0.3)); in TEST()
1105 Optional<TestObject> b; in TEST()
1116 Optional<TestObject> a; in TEST()
1117 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
1127 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
1128 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
1141 Optional<float> a(0.1f); in TEST()
1149 Optional<std::string> a("foo"); in TEST()
1157 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
1165 Optional<std::vector<int>> a; in TEST()
1174 Optional<std::vector<int>> a; in TEST()
1184 Optional<int> a; in TEST()
1185 Optional<int> b; in TEST()
1191 Optional<int> a(1); in TEST()
1192 Optional<int> b(1); in TEST()
1198 Optional<int> a; in TEST()
1199 Optional<int> b(1); in TEST()
1205 Optional<int> a(0); in TEST()
1206 Optional<int> b(1); in TEST()
1212 Optional<int> a(0); in TEST()
1213 Optional<double> b(0); in TEST()
1219 Optional<int> a; in TEST()
1220 Optional<int> b; in TEST()
1226 Optional<int> a(1); in TEST()
1227 Optional<int> b(1); in TEST()
1233 Optional<int> a; in TEST()
1234 Optional<int> b(1); in TEST()
1240 Optional<int> a(0); in TEST()
1241 Optional<int> b(1); in TEST()
1247 Optional<int> a(0); in TEST()
1248 Optional<double> b(0.0); in TEST()
1254 Optional<int> l; in TEST()
1255 Optional<int> r(1); in TEST()
1261 Optional<int> l(1); in TEST()
1262 Optional<int> r; in TEST()
1268 Optional<int> l; in TEST()
1269 Optional<int> r; in TEST()
1276 Optional<int> l(1); in TEST()
1277 Optional<int> r(2); in TEST()
1282 Optional<int> l(2); in TEST()
1283 Optional<int> r(1); in TEST()
1288 Optional<int> l(1); in TEST()
1289 Optional<int> r(1); in TEST()
1296 Optional<int> l(1); in TEST()
1297 Optional<double> r(2.0); in TEST()
1303 Optional<int> l; in TEST()
1304 Optional<int> r(1); in TEST()
1310 Optional<int> l(1); in TEST()
1311 Optional<int> r; in TEST()
1317 Optional<int> l; in TEST()
1318 Optional<int> r; in TEST()
1325 Optional<int> l(1); in TEST()
1326 Optional<int> r(2); in TEST()
1331 Optional<int> l(2); in TEST()
1332 Optional<int> r(1); in TEST()
1337 Optional<int> l(1); in TEST()
1338 Optional<int> r(1); in TEST()
1345 Optional<int> l(1); in TEST()
1346 Optional<double> r(2.0); in TEST()
1352 Optional<int> l; in TEST()
1353 Optional<int> r; in TEST()
1359 Optional<int> l; in TEST()
1360 Optional<int> r(1); in TEST()
1366 Optional<int> l(1); in TEST()
1367 Optional<int> r; in TEST()
1374 Optional<int> l(1); in TEST()
1375 Optional<int> r(2); in TEST()
1380 Optional<int> l(2); in TEST()
1381 Optional<int> r(1); in TEST()
1386 Optional<int> l(1); in TEST()
1387 Optional<int> r(1); in TEST()
1394 Optional<int> l(1); in TEST()
1395 Optional<double> r(2.0); in TEST()
1401 Optional<int> l; in TEST()
1402 Optional<int> r; in TEST()
1408 Optional<int> l; in TEST()
1409 Optional<int> r(1); in TEST()
1415 Optional<int> l(1); in TEST()
1416 Optional<int> r; in TEST()
1423 Optional<int> l(1); in TEST()
1424 Optional<int> r(2); in TEST()
1429 Optional<int> l(2); in TEST()
1430 Optional<int> r(1); in TEST()
1435 Optional<int> l(1); in TEST()
1436 Optional<int> r(1); in TEST()
1443 Optional<int> l(1); in TEST()
1444 Optional<double> r(2.0); in TEST()
1451 Optional<int> opt; in TEST()
1455 Optional<int> opt(1); in TEST()
1462 Optional<int> opt; in TEST()
1466 Optional<int> opt(1); in TEST()
1473 Optional<int> opt; in TEST()
1477 Optional<int> opt(1); in TEST()
1484 Optional<int> opt; in TEST()
1488 Optional<int> opt(1); in TEST()
1495 Optional<int> opt; in TEST()
1499 Optional<int> opt(1); in TEST()
1506 Optional<int> opt; in TEST()
1510 Optional<int> opt(1); in TEST()
1517 Optional<int> opt; in TEST()
1521 Optional<int> opt(1); in TEST()
1528 Optional<int> opt; in TEST()
1532 Optional<int> opt(1); in TEST()
1539 Optional<int> opt; in TEST()
1543 Optional<int> opt(1); in TEST()
1550 Optional<int> opt; in TEST()
1554 Optional<int> opt(1); in TEST()
1561 Optional<int> opt; in TEST()
1565 Optional<int> opt(1); in TEST()
1572 Optional<int> opt; in TEST()
1576 Optional<int> opt(1); in TEST()
1582 Optional<int> opt; in TEST()
1588 Optional<int> opt(0); in TEST()
1592 Optional<int> opt(1); in TEST()
1598 Optional<int> opt(0); in TEST()
1603 Optional<int> opt; in TEST()
1609 Optional<int> opt(0); in TEST()
1613 Optional<int> opt(1); in TEST()
1619 Optional<int> opt(0); in TEST()
1624 Optional<int> opt; in TEST()
1630 Optional<int> opt(0); in TEST()
1634 Optional<int> opt(1); in TEST()
1640 Optional<int> opt(0); in TEST()
1645 Optional<int> opt; in TEST()
1651 Optional<int> opt(0); in TEST()
1655 Optional<int> opt(1); in TEST()
1661 Optional<int> opt(0); in TEST()
1666 Optional<int> opt; in TEST()
1672 Optional<int> opt(0); in TEST()
1676 Optional<int> opt(1); in TEST()
1680 Optional<int> opt(2); in TEST()
1686 Optional<int> opt(0); in TEST()
1691 Optional<int> opt; in TEST()
1697 Optional<int> opt(0); in TEST()
1701 Optional<int> opt(1); in TEST()
1705 Optional<int> opt(2); in TEST()
1711 Optional<int> opt(0); in TEST()
1716 Optional<int> opt; in TEST()
1722 Optional<int> opt(0); in TEST()
1726 Optional<int> opt(1); in TEST()
1730 Optional<int> opt(2); in TEST()
1736 Optional<int> opt(0); in TEST()
1741 Optional<int> opt; in TEST()
1747 Optional<int> opt(0); in TEST()
1751 Optional<int> opt(1); in TEST()
1755 Optional<int> opt(2); in TEST()
1761 Optional<int> opt(0); in TEST()
1766 Optional<int> opt; in TEST()
1772 Optional<int> opt(0); in TEST()
1776 Optional<int> opt(1); in TEST()
1780 Optional<int> opt(2); in TEST()
1786 Optional<int> opt(0); in TEST()
1791 Optional<int> opt; in TEST()
1797 Optional<int> opt(0); in TEST()
1801 Optional<int> opt(1); in TEST()
1805 Optional<int> opt(2); in TEST()
1811 Optional<int> opt(0); in TEST()
1816 Optional<int> opt; in TEST()
1822 Optional<int> opt(0); in TEST()
1826 Optional<int> opt(1); in TEST()
1830 Optional<int> opt(2); in TEST()
1836 Optional<int> opt(0); in TEST()
1841 Optional<int> opt; in TEST()
1847 Optional<int> opt(0); in TEST()
1851 Optional<int> opt(1); in TEST()
1855 Optional<int> opt(2); in TEST()
1861 Optional<int> opt(0); in TEST()
1867 Optional<float> a(0.1f); in TEST()
1868 Optional<float> b(0.2f); in TEST()
1873 Optional<std::string> a("foo"); in TEST()
1874 Optional<std::string> b("bar"); in TEST()
1879 Optional<int> a(1); in TEST()
1880 Optional<double> b(2); in TEST()
1885 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1886 Optional<TestObject> b(TestObject(4, 1.0)); in TEST()
1893 Optional<float> a(0.1f); in TEST()
1894 Optional<float> b(0.1f); in TEST()
1900 Optional<std::string> a("foo"); in TEST()
1901 Optional<std::string> b("foo"); in TEST()
1907 Optional<TestObject> a(TestObject(3, 0.1)); in TEST()
1908 Optional<TestObject> b(TestObject(3, 0.1)); in TEST()
1921 Optional<float> o = base::make_optional(32.f); in TEST()
1932 Optional<std::string> o = base::make_optional(std::string("foo")); in TEST()
1943 Optional<TestObject> o = base::make_optional(TestObject(3, 0.1)); in TEST()
1967 Optional<Test> o = base::make_optional<Test>(1, 2.0, true); in TEST()
1985 Optional<TestObject> a, b; in TEST()
1995 Optional<TestObject> a(TestObject(1, 0.3)); in TEST()
1996 Optional<TestObject> b; in TEST()
2006 Optional<TestObject> a; in TEST()
2007 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
2017 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
2018 Optional<TestObject> b(TestObject(1, 0.3)); in TEST()
2032 std::hash<Optional<int>> opt_int_hash; in TEST()
2034 EXPECT_EQ(int_hash(1), opt_int_hash(Optional<int>(1))); in TEST()
2039 std::hash<Optional<std::string>> opt_str_hash; in TEST()
2042 opt_str_hash(Optional<std::string>(std::string("foobar")))); in TEST()
2047 std::hash<Optional<int>> opt_int_hash; in TEST()
2048 std::hash<Optional<std::string>> opt_str_hash; in TEST()
2050 EXPECT_EQ(opt_str_hash(Optional<std::string>()), in TEST()
2051 opt_int_hash(Optional<int>())); in TEST()
2055 std::set<Optional<int>> setOptInt; in TEST()
2059 setOptInt.insert(Optional<int>(3)); in TEST()
2065 Optional<int> a; in TEST()
2077 a = Optional<int>(); in TEST()
2082 Optional<int> a(0); in TEST()
2092 Optional<TestObject> a(TestObject(0, 0.1)); in TEST()
2102 Optional<int> a; in TEST()
2110 Optional<TestObject> a; in TEST()
2120 Optional<DeletedDefaultConstructor> a; in TEST()
2129 Optional<DeleteNewOperators> a; in TEST()
2166 noexcept(Optional<int>(std::declval<Optional<int>>())), in TEST()
2170 !noexcept(Optional<Test1>(std::declval<Optional<Test1>>())), in TEST()
2174 noexcept(Optional<Test2>(std::declval<Optional<Test2>>())), in TEST()
2178 noexcept(Optional<Test3>(std::declval<Optional<Test3>>())), in TEST()
2182 noexcept(Optional<Test4>(std::declval<Optional<Test4>>())), in TEST()
2186 !noexcept(Optional<Test5>(std::declval<Optional<Test5>>())), in TEST()
2191 noexcept(std::declval<Optional<int>>() = std::declval<Optional<int>>()), in TEST()
2195 !noexcept(std::declval<Optional<Test1>>() = in TEST()
2196 std::declval<Optional<Test1>>()), in TEST()
2199 !noexcept(std::declval<Optional<Test2>>() = in TEST()
2200 std::declval<Optional<Test2>>()), in TEST()