[span] fix size_t to index_type conversion warning

This commit is contained in:
Neil MacIntosh 2016-10-05 08:41:58 -07:00 committed by GitHub
commit 32ca283d53

View File

@ -392,7 +392,7 @@ public:
std::is_convertible<typename Container::pointer, pointer>::value &&
std::is_convertible<typename Container::pointer,
decltype(std::declval<Container>().data())>::value>>
constexpr span(Container& cont) : span(cont.data(), cont.size())
constexpr span(Container& cont) : span(cont.data(), narrow<index_type>(cont.size()))
{
}
@ -402,7 +402,7 @@ public:
std::is_convertible<typename Container::pointer, pointer>::value &&
std::is_convertible<typename Container::pointer,
decltype(std::declval<Container>().data())>::value>>
constexpr span(const Container& cont) : span(cont.data(), cont.size())
constexpr span(const Container& cont) : span(cont.data(), narrow<index_type>(cont.size()))
{
}