mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Added explicit cast to size_type in span constructor
This silences implicit sign conversion warnings when constructing span from containers which return size_t from size().
This commit is contained in:
parent
3cd0d523b6
commit
da75d0e757
@ -1267,7 +1267,7 @@ public:
|
||||
&& std::is_convertible<DataType (*)[], value_type (*)[]>::value
|
||||
&& std::is_same<std::decay_t<decltype(std::declval<Cont>().size(), *std::declval<Cont>().data())>, DataType>::value>
|
||||
>
|
||||
constexpr span (Cont& cont) : span(static_cast<pointer>(cont.data()), details::newBoundsHelper<bounds_type>(cont.size()))
|
||||
constexpr span (Cont& cont) : span(static_cast<pointer>(cont.data()), details::newBoundsHelper<bounds_type>(static_cast<size_type>(cont.size())))
|
||||
{}
|
||||
|
||||
constexpr span(const span &) = default;
|
||||
|
Loading…
Reference in New Issue
Block a user