update span specialization of at, change some tests back to int i with narrowing for the comparisons.

This commit is contained in:
Jordan Maples [MSFT]
2020-02-05 17:12:31 -08:00
parent 3b9d15f49f
commit a49ff1b8df
2 changed files with 11 additions and 10 deletions
+2 -1
View File
@@ -806,7 +806,8 @@ template <class ElementType, std::size_t Extent>
constexpr ElementType& at(span<ElementType, Extent> s, index i)
{
// No bounds checking here because it is done in span::operator[] called below
return s[i];
Ensures(i >= 0);
return s[narrow_cast<std::size_t>(i)];
}
// [span.obs] Free observer functions