diff --git a/include/gsl.h b/include/gsl.h index e20ac69..6eb29ce 100644 --- a/include/gsl.h +++ b/include/gsl.h @@ -45,6 +45,10 @@ #endif // _MSC_VER +#if (__GNUC__ < 5) && !defined(__clang__) +#define constexpr /* nothing */ +#endif + // In order to test the library, we need it to throw exceptions that we can catch #ifdef GSL_THROWS_FOR_TESTING #define noexcept /* nothing */ diff --git a/include/span.h b/include/span.h index 74da1aa..d094496 100644 --- a/include/span.h +++ b/include/span.h @@ -60,6 +60,10 @@ #endif // _MSC_VER +#if (__GNUC__ < 5) && !defined(__clang__) +#define constexpr /* nothing */ +#endif + // In order to test the library, we need it to throw exceptions that we can catch #ifdef GSL_THROWS_FOR_TESTING #define noexcept /* nothing */ @@ -227,6 +231,9 @@ private: #ifndef _MSC_VER +#if (__GNUC__ < 5) && !defined(__clang__) +const std::ptrdiff_t dynamic_range = -1; +#else struct static_bounds_dynamic_range_t { template ::value>> @@ -262,6 +269,8 @@ constexpr bool operator !=(T left, static_bounds_dynamic_range_t right) noexcept } constexpr static_bounds_dynamic_range_t dynamic_range{}; +#endif + #else const std::ptrdiff_t dynamic_range = -1; #endif