aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Furnish <gfurnish@gfurnish.net>2016-10-04 21:13:18 -0600
committerGary Furnish <gfurnish@gfurnish.net>2016-10-04 21:13:18 -0600
commit612747a5e1174760d71f0564a55eb4761375c709 (patch)
tree7eb58e29f99bab44095bbe24d6f355ee4d238132
parent023652e304f3675b18f22ed8dc258903ac41c56e (diff)
downloadplatform_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/span4
1 files changed, 2 insertions, 2 deletions
diff --git a/gsl/span b/gsl/span
index a9a3322..62b63de 100644
--- a/gsl/span
+++ b/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()))
{
}