Update expected.hpp

This commit is contained in:
Sy Brand
2023-02-15 16:17:09 +00:00
committed by GitHub
parent ac297a9f1e
commit 1369d77100

View File

@ -25,15 +25,6 @@
#include <type_traits>
#include <utility>
#if !defined(TL_ASSERT)
#if (__cplusplus > 201103L) //can't have assert in constexpr in C++11
#include <cassert>
#define TL_ASSERT(x) assert(x)
#else
#define TL_ASSERT(x)
#endif
#endif
#if defined(__EXCEPTIONS) || defined(_CPPUNWIND)
#define TL_EXPECTED_EXCEPTIONS_ENABLED
#endif
@ -60,6 +51,16 @@
#define TL_EXPECTED_GCC55
#endif
#if !defined(TL_ASSERT)
//can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug
#if (__cplusplus > 201103L) && !defined(TL_EXPECTED_GCC49)
#include <cassert>
#define TL_ASSERT(x) assert(x)
#else
#define TL_ASSERT(x)
#endif
#endif
#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \
!defined(__clang__))
// GCC < 5 doesn't support overloading on const&& for member functions