Skip to content

Commit

Permalink
better check for branch opt (#724)
Browse files Browse the repository at this point in the history
* Added c++17 test configurations for clang5.0 and clang6.0

* Simplified optimization in span::operator[]
  • Loading branch information
Anna Gringauze authored and neilmacintosh committed Aug 19, 2018
1 parent 86be236 commit 585f48c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/gsl/span
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 585f48c

Please sign in to comment.