mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
For span, fix size_t to index_type conversion warning.
Use narrow per discussion instead of static_cast.
This commit is contained in:
parent
023652e304
commit
612747a5e1
4
gsl/span
4
gsl/span
@ -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()))
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user