forked from boostorg/beast
Use boost::string_view
This commit is contained in:
1 parent
cc1c02e236
commit
44824a4166
7 files changed
+12
-10
No files matched your search
@@ -41,7 +41,7 @@ template<class CharT, class Traits>
|
||||
inline
|
||||
int
|
||||
lexicographical_compare(
|
||||
boost::basic_string_ref<CharT, Traits> s1,
|
||||
basic_string_view<CharT, Traits> s1,
|
||||
CharT const* s2, std::size_t n2)
|
||||
{
|
||||
return lexicographical_compare<CharT, Traits>(
|
||||
@@ -52,8 +52,8 @@ template<class CharT, class Traits>
|
||||
inline
|
||||
int
|
||||
lexicographical_compare(
|
||||
boost::basic_string_ref<CharT, Traits> s1,
|
||||
boost::basic_string_ref<CharT, Traits> s2)
|
||||
basic_string_view<CharT, Traits> s1,
|
||||
basic_string_view<CharT, Traits> s2)
|
||||
{
|
||||
return lexicographical_compare<CharT, Traits>(
|
||||
s1.data(), s1.size(), s2.data(), s2.size());
|
||||
|
||||
@@ -345,7 +345,7 @@ public:
|
||||
/// Convert a static string to a `string_view_type`
|
||||
operator string_view_type() const
|
||||
{
|
||||
return boost::basic_string_ref<
|
||||
return basic_string_view<
|
||||
CharT, Traits>{data(), size()};
|
||||
}
|
||||
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
#ifndef BEAST_STRING_HPP
|
||||
#define BEAST_STRING_HPP
|
||||
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <boost/utility/string_view.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
namespace beast {
|
||||
|
||||
/// The type of string view used by the library
|
||||
using string_view = boost::string_ref;
|
||||
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_ref<CharT, Traits>;
|
||||
boost::basic_string_view<CharT, Traits>;
|
||||
|
||||
namespace detail {
|
||||
|
||||
|
||||
Reference in new issue
Block a user