diff options
author | Gary Furnish <gfurnish@gfurnish.net> | 2016-10-04 21:13:18 -0600 |
---|---|---|
committer | Gary Furnish <gfurnish@gfurnish.net> | 2016-10-04 21:13:18 -0600 |
commit | 612747a5e1174760d71f0564a55eb4761375c709 (patch) | |
tree | 7eb58e29f99bab44095bbe24d6f355ee4d238132 | |
parent | 023652e304f3675b18f22ed8dc258903ac41c56e (diff) | |
download | platform_external_Microsoft-GSL-612747a5e1174760d71f0564a55eb4761375c709.tar.gz platform_external_Microsoft-GSL-612747a5e1174760d71f0564a55eb4761375c709.tar.bz2 platform_external_Microsoft-GSL-612747a5e1174760d71f0564a55eb4761375c709.zip |
For span, fix size_t to index_type conversion warning.
Use narrow per discussion instead of static_cast.
-rw-r--r-- | gsl/span | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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())) { } |