diff --git a/include/gsl/span b/include/gsl/span index 7c15eb4..469a2db 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -441,23 +441,6 @@ public: : storage_(KnownNotNull{arr + 0}, details::extent_type()) {} -// #define useold -#if defined(useold) - template ::value, int> = 0> - constexpr span(std::array& arr) noexcept - : storage_(KnownNotNull{arr.data()}, details::extent_type()) - {} - - template ::value && - details::is_allowed_element_type_conversion::value), - int> = 0> - constexpr span(const std::array& arr) noexcept - : storage_(KnownNotNull{arr.data()}, details::extent_type()) - {} -#else template ::value && details::is_allowed_element_type_conversion::value), int> = 0> @@ -473,7 +456,7 @@ public: constexpr span(const std::array& arr) noexcept : storage_(KnownNotNull{arr.data()}, details::extent_type()) {} -#endif + // NB: the SFINAE here uses .data() as an incomplete/imperfect proxy for the requirement // on Container to be a contiguous sequence container. template stl{{100, 200, 300}}; std::array stl_nullptr{{nullptr,nullptr,nullptr}}; +#if __cplusplus >= 201703l + // This std::is_convertible_v fails for C++14 + // so these conversions aren't valid in C++14 { gsl::span sp_const_nullptr_1{stl_nullptr}; EXPECT_TRUE(sp_const_nullptr_1.data() == stl_nullptr.data()); EXPECT_TRUE(sp_const_nullptr_1.size() == 3); -#if __cplusplus >= 201703l span sp_const_nullptr_2{std::as_const(stl_nullptr)}; EXPECT_TRUE(sp_const_nullptr_2.data() == stl_nullptr.data()); EXPECT_TRUE(sp_const_nullptr_2.size() == 3); static_assert(std::is_same); static_assert(std::is_same); -#endif } +#endif { gsl::span sp_dyn;