address build failures

This commit is contained in:
Jordan Maples [MSFT] 2020-02-07 14:40:09 -08:00
parent b81d6e40e1
commit d8fa68c4a5
2 changed files with 2 additions and 2 deletions

View File

@ -430,7 +430,7 @@ public:
constexpr span(pointer firstElem, pointer lastElem) noexcept constexpr span(pointer firstElem, pointer lastElem) noexcept
: storage_(firstElem, static_cast<std::size_t>(std::distance(firstElem, lastElem))) : storage_(firstElem, static_cast<std::size_t>(std::distance(firstElem, lastElem)))
{ {
if (Extent != dynamic_extent) { Expects(lastElem - firstElem == Extent); } if (Extent != dynamic_extent) { Expects(lastElem - firstElem == static_cast<difference_type>(Extent)); }
} }
template <std::size_t N> template <std::size_t N>

View File

@ -1550,10 +1550,10 @@ TEST(span_test, from_array_constructor)
// even when done dynamically // even when done dynamically
{ {
span<int> s = arr;
/* /*
// this now results in a compile-time error, rather than runtime. // this now results in a compile-time error, rather than runtime.
// There is no suitable conversion from dynamic span to fixed span. // There is no suitable conversion from dynamic span to fixed span.
span<int> s = arr;
auto f = [&]() { auto f = [&]() {
const span<int, 2> s2 = s; const span<int, 2> s2 = s;
static_cast<void>(s2); static_cast<void>(s2);