fix build breaks

This commit is contained in:
Jordan Maples [MSFT] 2020-02-03 12:26:15 -08:00
parent c31593dd0d
commit ad71477183
4 changed files with 9 additions and 9 deletions

View File

@ -37,8 +37,8 @@ namespace gsl
{ {
// Note: this will generate faster code than std::copy using span iterator in older msvc+stl // Note: this will generate faster code than std::copy using span iterator in older msvc+stl
// not necessary for msvc since VS2017 15.8 (_MSC_VER >= 1915) // not necessary for msvc since VS2017 15.8 (_MSC_VER >= 1915)
template <class SrcElementType, std::ptrdiff_t SrcExtent, class DestElementType, template <class SrcElementType, std::size_t SrcExtent, class DestElementType,
std::ptrdiff_t DestExtent> std::size_t DestExtent>
void copy(span<SrcElementType, SrcExtent> src, span<DestElementType, DestExtent> dest) void copy(span<SrcElementType, SrcExtent> src, span<DestElementType, DestExtent> dest)
{ {
static_assert(std::is_assignable<decltype(*dest.data()), decltype(*src.data())>::value, static_assert(std::is_assignable<decltype(*dest.data()), decltype(*src.data())>::value,

View File

@ -592,7 +592,7 @@ private:
} }
else else
{ {
return idx >= 0 && idx < size; return idx < size;
} }
} }

View File

@ -966,7 +966,7 @@ TEST(span_test, from_array_constructor)
EXPECT_TRUE(av.subspan(5).size() == 0); EXPECT_TRUE(av.subspan(5).size() == 0);
EXPECT_DEATH(av.subspan(6).size(), deathstring); EXPECT_DEATH(av.subspan(6).size(), deathstring);
const auto av2 = av.subspan(1); const auto av2 = av.subspan(1);
for (std::size_t i = 0; i < 4; ++i) EXPECT_TRUE(av2[i] == i + 2); for (std::size_t i = 0; i < 4; ++i) EXPECT_TRUE(av2[i] == static_cast<int>(i) + 2);
} }
{ {
@ -977,7 +977,7 @@ TEST(span_test, from_array_constructor)
EXPECT_TRUE(av.subspan(5).size() == 0); EXPECT_TRUE(av.subspan(5).size() == 0);
EXPECT_DEATH(av.subspan(6).size(), deathstring); EXPECT_DEATH(av.subspan(6).size(), deathstring);
const auto av2 = av.subspan(1); const auto av2 = av.subspan(1);
for (std::size_t i = 0; i < 4; ++i) EXPECT_TRUE(av2[i] == i + 2); for (std::size_t i = 0; i < 4; ++i) EXPECT_TRUE(av2[i] == static_cast<int>(i) + 2);
} }
} }

View File

@ -84,7 +84,7 @@ czstring_span<> CreateTempName(string_span<> span)
{ {
Expects(span.size() > 1); Expects(span.size() > 1);
int last = 0; std::size_t last = 0;
if (span.size() > 4) { if (span.size() > 4) {
span[0] = 't'; span[0] = 't';
span[1] = 'm'; span[1] = 'm';
@ -101,7 +101,7 @@ cwzstring_span<> CreateTempNameW(wstring_span<> span)
{ {
Expects(span.size() > 1); Expects(span.size() > 1);
int last = 0; std::size_t last = 0;
if (span.size() > 4) { if (span.size() > 4) {
span[0] = L't'; span[0] = L't';
span[1] = L'm'; span[1] = L'm';
@ -118,7 +118,7 @@ cu16zstring_span<> CreateTempNameU16(u16string_span<> span)
{ {
Expects(span.size() > 1); Expects(span.size() > 1);
int last = 0; std::size_t last = 0;
if (span.size() > 4) { if (span.size() > 4) {
span[0] = u't'; span[0] = u't';
span[1] = u'm'; span[1] = u'm';
@ -135,7 +135,7 @@ cu32zstring_span<> CreateTempNameU32(u32string_span<> span)
{ {
Expects(span.size() > 1); Expects(span.size() > 1);
int last = 0; std::size_t last = 0;
if (span.size() > 4) { if (span.size() > 4) {
span[0] = U't'; span[0] = U't';
span[1] = U'm'; span[1] = U'm';