forked from boostorg/beast
Add BOOST_BEAST_USE_STD_STRING_VIEW:
fix #1133, fix #1241 When the macro BOOST_BEAST_USE_STD_STRING_VIEW is defined, Beast will use std::string_view instead of boost::string_view. The name boost::beast::string_view is a type alias for the chosen view type.
This commit is contained in:
1 parent
f3212eba48
commit
806979e37b
7 files changed
+36
-14
No files matched your search
@@ -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;
|
||||
#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 =
|
||||
boost::basic_string_view<CharT, Traits>;
|
||||
/// 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 {
|
||||
|
||||
|
||||
Reference in new issue
Block a user