From 585f48ce55c720a3f812f79ef57596e67f52eb89 Mon Sep 17 00:00:00 2001 From: Anna Gringauze Date: Sun, 19 Aug 2018 16:27:30 -0700 Subject: [PATCH] better check for branch opt (#724) * Added c++17 test configurations for clang5.0 and clang6.0 * Simplified optimization in span::operator[] --- include/gsl/span | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); }