Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Gringauze <annagrin@microsoft.com>2018-08-20 02:27:30 +0300
committerNeil MacIntosh <neilmac@fb.com>2018-08-20 02:27:30 +0300
commit585f48ce55c720a3f812f79ef57596e67f52eb89 (patch)
tree40fab118366f205a006ba0411c5df551e11a09fa
parent86be2366c73a19b77cc7a6674cc0e3d118efcdf9 (diff)
better check for branch opt (#724)
* Added c++17 test configurations for clang5.0 and clang6.0 * Simplified optimization in span::operator[]
-rw-r--r--include/gsl/span3
1 files changed, 1 insertions, 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<unsigned long long>(std::numeric_limits<index_type>::max()) <
- narrow_cast<unsigned long long>(std::numeric_limits<size_t>::max()))
+ if (sizeof(index_type) <= sizeof(size_t))
{
return narrow_cast<size_t>(idx) < narrow_cast<size_t>(size);
}