summaryrefslogtreecommitdiff
path: root/boost/beast/core/string_type.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/beast/core/string_type.hpp')
-rw-r--r--boost/beast/core/string_type.hpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/boost/beast/core/string_type.hpp b/boost/beast/core/string_type.hpp
index b6b3f00534..bbb09db809 100644
--- a/boost/beast/core/string_type.hpp
+++ b/boost/beast/core/string_type.hpp
@@ -12,32 +12,29 @@
#include <boost/beast/core/detail/config.hpp>
+#include <boost/core/detail/string_view.hpp>
#if defined(BOOST_BEAST_USE_STD_STRING_VIEW)
-#include <string_view>
-#else
-#include <boost/utility/string_view.hpp>
+#include <boost/config/pragma_message.hpp>
+BOOST_PRAGMA_MESSAGE("BOOST_BEAST_USE_STD_STRING_VIEW is deprecated, use BOOST_NO_CXX17_HDR_STRING_VIEW instead");
#endif
namespace boost {
namespace beast {
-#if BOOST_BEAST_DOXYGEN || ! defined(BOOST_BEAST_USE_STD_STRING_VIEW)
/// The type of string view used by the library
-using string_view = boost::string_view;
+using string_view = boost::core::string_view;
/// The type of `basic_string_view` used by the library
-template<class CharT, class Traits>
+template<class CharT>
using basic_string_view =
- boost::basic_string_view<CharT, Traits>;
-
-#else
-using string_view = std::string_view;
-
-template<class CharT, class Traits>
-using basic_string_view =
- std::basic_string_view<CharT, Traits>;
-
-#endif
+ boost::core::basic_string_view<CharT>;
+
+template<class S>
+inline string_view
+to_string_view(const S& s)
+{
+ return string_view(s.data(), s.size());
+}
} // beast
} // boost