diff --git a/include/gsl/span b/include/gsl/span index b356ee9..54f5f6b 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -556,7 +556,11 @@ private: // wrap around to a value always greater than size when casted. // check if we have enough space to wrap around +#if defined(__cpp_if_constexpr) + if constexpr (sizeof(index_type) <= sizeof(size_t)) +#else if (sizeof(index_type) <= sizeof(size_t)) +#endif { return narrow_cast(idx) < narrow_cast(size); }