diff --git a/include/boost/core/span.hpp b/include/boost/core/span.hpp index 39688c6..99a2dd7 100644 --- a/include/boost/core/span.hpp +++ b/include/boost/core/span.hpp @@ -8,11 +8,10 @@ Distributed under the Boost Software License, Version 1.0. #ifndef BOOST_CORE_SPAN_HPP #define BOOST_CORE_SPAN_HPP +#include #include -#include #include #include -#include namespace boost { @@ -63,29 +62,8 @@ struct span_is_array > { static constexpr bool value = true; }; -template -inline constexpr auto -span_begin(C& c) noexcept(noexcept(c.data())) -> decltype(c.data()) -{ - return c.data(); -} - -template -inline constexpr auto -span_begin(const C& c) noexcept(noexcept(c.data())) -> decltype(c.data()) -{ - return c.data(); -} - template -inline constexpr const T* -span_begin(std::initializer_list l) noexcept -{ - return l.begin(); -} - -template -using span_ptr = decltype(boost::detail::span_begin(std::declval())); +using span_ptr = decltype(boost::data(std::declval())); template struct span_data { }; @@ -245,16 +223,16 @@ public: template::value, int>::type = 0> - constexpr span(R&& r) noexcept(noexcept(detail::span_begin(r)) && + constexpr span(R&& r) noexcept(noexcept(boost::data(r)) && noexcept(r.size())) - : s_(detail::span_begin(r), r.size()) { } + : s_(boost::data(r), r.size()) { } template::value, int>::type = 0> - explicit constexpr span(R&& r) noexcept(noexcept(detail::span_begin(r)) && + explicit constexpr span(R&& r) noexcept(noexcept(boost::data(r)) && noexcept(r.size())) - : s_(detail::span_begin(r), r.size()) { } + : s_(boost::data(r), r.size()) { } template::value &&