diff --git a/include/gsl/span b/include/gsl/span index b3f4f83..a4f9256 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -545,8 +545,7 @@ private: // wrap around to a value always greater than size when casted. // check if we have enough space to wrap around - if (narrow_cast(std::numeric_limits::max()) < - narrow_cast(std::numeric_limits::max())) + if (sizeof(index_type) <= sizeof(size_t)) { return narrow_cast(idx) < narrow_cast(size); }