Merge branch 'dev/jomaples/unsigned' of https://github.com/jordanmaples/gsl into dev/jomaples/unsigned

This commit is contained in:
Jordan Maples [MSFT] 2020-02-03 13:52:11 -08:00
commit 3e40b3fa4b
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@
#include <array> // for array #include <array> // for array
#include <cstddef> // for ptrdiff_t, size_t, nullptr_t #include <cstddef> // for ptrdiff_t, size_t, nullptr_t
#include <iterator> // for reverse_iterator, distance, random_access_... #include <iterator> // for reverse_iterator, distance, random_access_...
#include <memory> // for std::addressof #include <memory> // for std::addressof
#include <stdexcept> #include <stdexcept>
#include <type_traits> // for enable_if_t, declval, is_convertible, inte... #include <type_traits> // for enable_if_t, declval, is_convertible, inte...
#include <utility> #include <utility>
@ -475,7 +475,7 @@ public:
typename details::calculate_subspan_type<ElementType, Extent, Offset, Count>::type typename details::calculate_subspan_type<ElementType, Extent, Offset, Count>::type
{ {
Expects((size() >= Offset) && Expects((size() >= Offset) &&
(Count == dynamic_extent || (Offset + Count <= size()))); (Count == dynamic_extent || (Count <= size() - Offset)));
return {data() + Offset, Count == dynamic_extent ? size() - Offset : Count}; return {data() + Offset, Count == dynamic_extent ? size() - Offset : Count};
} }

View File

@ -26,7 +26,7 @@
#include <cstddef> // for size_t, nullptr_t #include <cstddef> // for size_t, nullptr_t
#include <cstdint> // for PTRDIFF_MAX #include <cstdint> // for PTRDIFF_MAX
#include <cstring> #include <cstring>
#include <string> // for basic_string, allocator, char_traits #include <string> // for basic_string, allocator, char_traits
#include <type_traits> // for declval, is_convertible, enable_if_t, add_... #include <type_traits> // for declval, is_convertible, enable_if_t, add_...
#if defined(_MSC_VER) && !defined(__clang__) #if defined(_MSC_VER) && !defined(__clang__)