mirror of
https://github.com/TartanLlama/optional.git
synced 2025-07-30 09:57:13 +02:00
Constexpr fixes
This commit is contained in:
@ -122,7 +122,8 @@ TEST_CASE("Monadic operations", "[monadic]") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SECTION("map constexpr") {
|
SECTION("map constexpr") {
|
||||||
#if !defined(_MSC_VER) && !defined(TL_OPTIONAL_GCC49)
|
#if !defined(_MSC_VER) && !defined(TL_OPTIONAL_GCC49) && \
|
||||||
|
!defined(TL_OPTIONAL_GCC54)
|
||||||
// test each overload in turn
|
// test each overload in turn
|
||||||
constexpr tl::optional<int> o16 = 42;
|
constexpr tl::optional<int> o16 = 42;
|
||||||
constexpr auto o16r = o16.map(get_int);
|
constexpr auto o16r = o16.map(get_int);
|
||||||
@ -232,7 +233,8 @@ TEST_CASE("Monadic operations", "[monadic]") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SECTION("constexpr and_then") {
|
SECTION("constexpr and_then") {
|
||||||
#if !defined(_MSC_VER) && !defined(TL_OPTIONAL_GCC49)
|
#if !defined(_MSC_VER) && !defined(TL_OPTIONAL_GCC49) && \
|
||||||
|
!defined(TL_OPTIONAL_GCC54)
|
||||||
constexpr tl::optional<int> o10 = 42;
|
constexpr tl::optional<int> o10 = 42;
|
||||||
constexpr auto o10r = o10.and_then(get_opt_int);
|
constexpr auto o10r = o10.and_then(get_opt_int);
|
||||||
REQUIRE(*o10r == 42);
|
REQUIRE(*o10r == 42);
|
||||||
|
Reference in New Issue
Block a user