better check for branch opt (#724)

* Added c++17 test configurations for clang5.0 and clang6.0

* Simplified optimization in span::operator[]
This commit is contained in:
Anna Gringauze 2018-08-19 16:27:30 -07:00 committed by Neil MacIntosh
parent 86be2366c7
commit 585f48ce55

View File

@ -545,8 +545,7 @@ private:
// wrap around to a value always greater than size when casted. // wrap around to a value always greater than size when casted.
// check if we have enough space to wrap around // check if we have enough space to wrap around
if (narrow_cast<unsigned long long>(std::numeric_limits<index_type>::max()) < if (sizeof(index_type) <= sizeof(size_t))
narrow_cast<unsigned long long>(std::numeric_limits<size_t>::max()))
{ {
return narrow_cast<size_t>(idx) < narrow_cast<size_t>(size); return narrow_cast<size_t>(idx) < narrow_cast<size_t>(size);
} }