summaryrefslogtreecommitdiff
path: root/boost/beast/core/string.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/beast/core/string.hpp')
-rw-r--r--boost/beast/core/string.hpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/boost/beast/core/string.hpp b/boost/beast/core/string.hpp
index 27bfa57165..de94d2e639 100644
--- a/boost/beast/core/string.hpp
+++ b/boost/beast/core/string.hpp
@@ -12,19 +12,35 @@
#include <boost/beast/core/detail/config.hpp>
#include <boost/version.hpp>
+
+#if defined(BOOST_BEAST_USE_STD_STRING_VIEW)
+#include <string_view>
+#else
#include <boost/utility/string_view.hpp>
+#endif
+
#include <algorithm>
namespace boost {
namespace beast {
-/// The type of string view used by the library
-using string_view = boost::string_view;
-
-/// The type of basic string view used by the library
-template<class CharT, class Traits>
-using basic_string_view =
- boost::basic_string_view<CharT, Traits>;
+#if defined(BOOST_BEAST_USE_STD_STRING_VIEW)
+ /// The type of string view used by the library
+ using string_view = std::string_view;
+
+ /// The type of basic string view used by the library
+ template<class CharT, class Traits>
+ using basic_string_view =
+ std::basic_string_view<CharT, Traits>;
+#else
+ /// The type of string view used by the library
+ using string_view = boost::string_view;
+
+ /// The type of basic string view used by the library
+ template<class CharT, class Traits>
+ using basic_string_view =
+ boost::basic_string_view<CharT, Traits>;
+#endif
namespace detail {