mirror of
https://github.com/TartanLlama/optional.git
synced 2025-08-04 12:14:26 +02:00
Support GCC 4.9
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
REQUIRE(e);
|
||||
|
||||
TEST_CASE("Constexpr", "[constexpr]") {
|
||||
#if !(_MSC_VER == 1900)
|
||||
#if !defined(TL_OPTIONAL_MSVC2015) && !defined(TL_OPTIONAL_GCC49)
|
||||
SECTION("empty construct") {
|
||||
constexpr tl::optional<int> o2{};
|
||||
constexpr tl::optional<int> o3 = {};
|
||||
|
@@ -9,7 +9,7 @@
|
||||
REQUIRE(e);
|
||||
|
||||
constexpr int get_int(int) { return 42; }
|
||||
TL_OPTIONAL_MSVC_2015_CONSTEXPR tl::optional<int> get_opt_int(int) { return 42; }
|
||||
TL_OPTIONAL_11_CONSTEXPR tl::optional<int> get_opt_int(int) { return 42; }
|
||||
|
||||
// What is Clang Format up to?!
|
||||
TEST_CASE("Monadic operations",
|
||||
@@ -193,7 +193,7 @@ REQUIRE(!o39r);
|
||||
}
|
||||
|
||||
SECTION("map constexpr") {
|
||||
#ifndef _MSC_VER
|
||||
#if !defined(_MSC_VER) && !defined(TL_OPTIONAL_GCC49)
|
||||
// test each overload in turn
|
||||
constexpr tl::optional<int> o16 = 42;
|
||||
constexpr auto o16r = o16.map(get_int);
|
||||
@@ -320,7 +320,7 @@ SECTION("and_then") {
|
||||
}
|
||||
|
||||
SECTION("constexpr and_then") {
|
||||
#ifndef _MSC_VER
|
||||
#if !defined(_MSC_VER) && !defined(TL_OPTIONAL_GCC49)
|
||||
constexpr tl::optional<int> o10 = 42;
|
||||
constexpr auto o10r = o10.and_then(get_opt_int);
|
||||
REQUIRE(*o10r == 42);
|
||||
|
Reference in New Issue
Block a user