Fix C++11 on GCC5.4

This commit is contained in:
Simon Brand
2018-02-17 08:44:31 +00:00
parent fc79f85606
commit 65d32a93a4
2 changed files with 4 additions and 4 deletions

View File

@@ -25,6 +25,7 @@ target_include_directories(expected INTERFACE ${CMAKE_SOURCE_DIR}/tl)
target_link_libraries(tests Catch expected) target_link_libraries(tests Catch expected)
set_property(TARGET tests PROPERTY CXX_STANDARD 14) set_property(TARGET tests PROPERTY CXX_STANDARD 14)
set_property(TARGET tests PROPERTY CXX_FLAGS "-Wall -Wextra")
find_package(standardese) # find standardese after installation find_package(standardese) # find standardese after installation

View File

@@ -81,8 +81,7 @@
#endif #endif
#if (__cplusplus == 201103L || defined(TL_EXPECTED_MSVC2015) || \ #if (__cplusplus == 201103L || defined(TL_EXPECTED_MSVC2015) || \
defined(TL_EXPECTED_GCC49)) && \ defined(TL_EXPECTED_GCC49))
!defined(TL_EXPECTED_GCC54)
/// \exclude /// \exclude
#define TL_EXPECTED_11_CONSTEXPR #define TL_EXPECTED_11_CONSTEXPR
#else #else
@@ -1702,7 +1701,7 @@ public:
/// ///
/// \group value /// \group value
template <class U=T, detail::enable_if_t<!std::is_void<U>::value>* = nullptr> template <class U=T, detail::enable_if_t<!std::is_void<U>::value>* = nullptr>
TL_EXPECTED_GCC49_CONSTEXPR const U &value() const & { TL_EXPECTED_11_CONSTEXPR const U &value() const & {
if (!has_value()) if (!has_value())
throw bad_expected_access<E>(err().value()); throw bad_expected_access<E>(err().value());
return val(); return val();
@@ -1716,7 +1715,7 @@ public:
} }
/// \group value /// \group value
template <class U=T, detail::enable_if_t<!std::is_void<U>::value>* = nullptr> template <class U=T, detail::enable_if_t<!std::is_void<U>::value>* = nullptr>
TL_EXPECTED_GCC49_CONSTEXPR const U &&value() const && { TL_EXPECTED_11_CONSTEXPR const U &&value() const && {
if (!has_value()) if (!has_value())
throw bad_expected_access<E>(err().value()); throw bad_expected_access<E>(err().value());
return std::move(val()); return std::move(val());