Support GCC 4.8

This commit is contained in:
Simon Brand
2017-10-21 22:31:42 +01:00
parent 7a6d918382
commit 1f22aabe21
4 changed files with 33 additions and 5 deletions
+4 -4
View File
@@ -374,18 +374,18 @@ SECTION("conjunction") {
SECTION("map_or") {
tl::optional<int> o1 = 21;
REQUIRE((o1.map_or([](auto x) { return x * 2; }, 13)) == 42);
REQUIRE((o1.map_or([](int x) { return x * 2; }, 13)) == 42);
tl::optional<int> o2;
REQUIRE((o2.map_or([](auto x) { return x * 2; }, 13)) == 13);
REQUIRE((o2.map_or([](int x) { return x * 2; }, 13)) == 13);
}
SECTION("map_or_else") {
tl::optional<int> o1 = 21;
REQUIRE((o1.map_or_else([](auto x) { return x * 2; }, []{return 13;})) == 42);
REQUIRE((o1.map_or_else([](int x) { return x * 2; }, []{return 13;})) == 42);
tl::optional<int> o2;
REQUIRE((o2.map_or_else([](auto x) { return x * 2; }, []{return 13;})) == 13);
REQUIRE((o2.map_or_else([](int x) { return x * 2; }, []{return 13;})) == 13);
}
SECTION("take") {