Skip to content

Commit

Permalink
Remove BOOST_BEAST_USE_STD_STRING_VIEW
Browse files Browse the repository at this point in the history
  • Loading branch information
sehe committed Jun 15, 2022
1 parent c2cff22 commit 9a8429b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 30 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ build: off
test_script:
- b2 --debug-configuration variant=release cxxstd=14 address-model=64 toolset=msvc-14.0 libs/beast/example -j3
- b2 --debug-configuration variant=release cxxstd=14 address-model=64 toolset=msvc-14.0 --verbose-test libs/beast/test//run-fat-tests -j3
- b2 --debug-configuration variant=release cxxstd=17 define="BOOST_BEAST_USE_STD_STRING_VIEW" address-model=64 toolset=msvc-14.1 libs/beast/example -j3
- b2 --debug-configuration variant=release cxxstd=17 define="BOOST_BEAST_USE_STD_STRING_VIEW" address-model=64 toolset=msvc-14.1 --verbose-test libs/beast/test//run-fat-tests -j3
- b2 --debug-configuration variant=release cxxstd=17 address-model=64 toolset=msvc-14.1 libs/beast/example -j3
- b2 --debug-configuration variant=release cxxstd=17 address-model=64 toolset=msvc-14.1 --verbose-test libs/beast/test//run-fat-tests -j3

cache:
- c:\tools\vcpkg\installed\
4 changes: 0 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
CXX: g++-9
PACKAGES: g++-9
VARIANT: release
B2_FLAGS: <define>BOOST_BEAST_USE_STD_STRING_VIEW
CXXSTD: 17
B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example
GCC 9 C++11 HEADER_ONLY NO_DEPRECATED:
Expand Down Expand Up @@ -86,7 +85,6 @@ jobs:
CXX: g++-8
PACKAGES: g++-8
VARIANT: release
B2_FLAGS: <define>BOOST_BEAST_USE_STD_STRING_VIEW
CXXSTD: 17
B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example
GCC 8 C++11 HEADER_ONLY NO_DEPRECATED:
Expand Down Expand Up @@ -303,13 +301,11 @@ jobs:
MSVC14.2 C++17 x64:
VM_IMAGE: 'windows-2019'
TOOLSET: msvc-14.2
B2_FLAGS: define=BOOST_BEAST_USE_STD_STRING_VIEW
CXXSTD: 17
ADDRMODEL: 64
MSVC14.1 C++17 x64:
VM_IMAGE: 'vs2017-win2016'
TOOLSET: msvc-14.1
B2_FLAGS: define=BOOST_BEAST_USE_STD_STRING_VIEW
CXXSTD: 17
ADDRMODEL: 64
MSVC14.0 C++11 x64:
Expand Down
8 changes: 0 additions & 8 deletions doc/qbk/03_core/8_conf_macros.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ failure to do so may result in violations of ODR (One Definition Rule).

[table Special Fields
[[Definition][Description]]
[
[
BOOST_BEAST_USE_STD_STRING_VIEW
][
Causes Beast to use std::string_view instead of boost::string_view.
Requires C++17.
]
]
[
[
BOOST_BEAST_SEPARATE_COMPILATION
Expand Down
1 change: 1 addition & 0 deletions doc/qbk/release_notes.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

[*Miscellaneous]

* [issue 2363] Remove `BOOST_BEAST_USE_STD_STRING_VIEW`
* [issue 2417] use boost::core::string_view. This improves inter-conversion between string_view implementations. Some observable differences for users:
* `core::string_view` no longer supports the `.to_string()` or `.clear()` extensions from Utility
* code that relied on `.max_size()` returning `.size(),` needs to be fixed to use `.size()` instead
Expand Down
18 changes: 2 additions & 16 deletions include/boost/beast/core/string_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,18 @@

#include <boost/beast/core/detail/config.hpp>

#if defined(BOOST_BEAST_USE_STD_STRING_VIEW)
#include <string_view>
#else
#include <boost/core/detail/string_view.hpp>
#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::core::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>;

#else
using string_view = std::string_view;

template<class CharT, class Traits>
template<class CharT>
using basic_string_view =
std::basic_string_view<CharT, Traits>;

#endif
boost::core::basic_string_view<CharT>;

template<class S>
inline string_view
Expand Down

0 comments on commit 9a8429b

Please sign in to comment.