Skip to content

Commit 7300ef4

Browse files
authored
Removed BOOST_BEAST_USE_STD_STRING_VIEW (boostorg#2451)
Fixes boostorg#2363
1 parent 12c2d14 commit 7300ef4

File tree

8 files changed

+24
-35
lines changed

8 files changed

+24
-35
lines changed

.drone.star

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def main(ctx):
5656
linux_cxx("clang 6.0 libc++", "clang++-6.0", packages="clang-6.0 libc6-dbg libc++-dev libstdc++-8-dev libc++abi-dev", llvm_os="bionic", llvm_ver="6.0", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'B2_CXXSTD': '11,14', 'B2_STDLIB': 'libc++', 'DRONE_JOB_UUID': 'b3f0c7f6bb'}, globalenv=globalenv),
5757
osx_cxx("clang", "g++", packages="", buildtype="boost", buildscript="drone", environment={'B2_TOOLSET': 'clang', 'B2_CXXSTD': '11,17', 'DRONE_JOB_UUID': '91032ad7bb'}, globalenv=globalenv),
5858
linux_cxx("coverity", "g++", packages="", buildtype="coverity", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'Coverity Scan', 'B2_TOOLSET': 'clang', 'DRONE_JOB_UUID': '472b07b9fc'}, globalenv=globalenv),
59-
windows_cxx("msvc-14.1", "", image="cppalliance/dronevs2017", buildtype="boost", buildscript="drone", environment={ "VARIANT": "release", "TOOLSET": "msvc-14.1", "CXXSTD": "17", "DEFINE" : "BOOST_BEAST_USE_STD_STRING_VIEW", "ADDRESS_MODEL": "64"}),
60-
windows_cxx("msvc-14.2", "", image="cppalliance/dronevs2019", buildtype="boost", buildscript="drone", environment={ "VARIANT": "release", "TOOLSET": "msvc-14.2", "CXXSTD": "17", "DEFINE" : "BOOST_BEAST_USE_STD_STRING_VIEW", "ADDRESS_MODEL": "64"}),
61-
windows_cxx("msvc-14.3", "", image="cppalliance/dronevs2022:1", buildtype="boost", buildscript="drone", environment={ "VARIANT": "release", "TOOLSET": "msvc-14.3", "CXXSTD": "20", "DEFINE" : "BOOST_BEAST_USE_STD_STRING_VIEW", "ADDRESS_MODEL": "64"}),
59+
windows_cxx("msvc-14.1", "", image="cppalliance/dronevs2017", buildtype="boost", buildscript="drone", environment={ "VARIANT": "release", "TOOLSET": "msvc-14.1", "CXXSTD": "17", "ADDRESS_MODEL": "64"}),
60+
windows_cxx("msvc-14.2", "", image="cppalliance/dronevs2019", buildtype="boost", buildscript="drone", environment={ "VARIANT": "release", "TOOLSET": "msvc-14.2", "CXXSTD": "17", "ADDRESS_MODEL": "64"}),
61+
windows_cxx("msvc-14.3", "", image="cppalliance/dronevs2022:1", buildtype="boost", buildscript="drone", environment={ "VARIANT": "release", "TOOLSET": "msvc-14.3", "CXXSTD": "20", "ADDRESS_MODEL": "64"}),
6262
]
6363

6464
# from https://github.com/boostorg/boost-ci

.drone/drone.bat

+5-3
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ b2 headers
2222

2323
echo "============> SCRIPT"
2424

25+
IF DEFINED DEFINE SET B2_DEFINE="define=%DEFINE%"
26+
2527
echo "Running tests"
26-
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% define=%DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test -j3
28+
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test -j3
2729
if !errorlevel! neq 0 exit /b !errorlevel!
2830

2931
echo "Running libs/beast/example"
30-
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% define=%DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% libs/beast/example -j3
32+
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% libs/beast/example -j3
3133
if !errorlevel! neq 0 exit /b !errorlevel!
3234

3335
echo "Running run-fat-tests"
34-
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% define=%DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test//run-fat-tests -j3
36+
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test//run-fat-tests -j3
3537
if !errorlevel! neq 0 exit /b !errorlevel!
3638

3739
echo "============> COMPLETED"

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 339:
2+
3+
* BOOST_BEAST_USE_STD_STRING_VIEW is replaced by boost/core string_view.
4+
* defining BOOST_BEAST_USE_STD_STRING_VIEW yields a deprecation warning
5+
6+
--------------------------------------------------------------------------------
7+
8+
19
Version 338:
210

311
* Added per message compression options.

appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ build: off
4747
test_script:
4848
- b2 --debug-configuration variant=release cxxstd=14 address-model=64 toolset=msvc-14.0 libs/beast/example -j3
4949
- b2 --debug-configuration variant=release cxxstd=14 address-model=64 toolset=msvc-14.0 --verbose-test libs/beast/test//run-fat-tests -j3
50-
- 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
51-
- 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
50+
- b2 --debug-configuration variant=release cxxstd=17 address-model=64 toolset=msvc-14.1 libs/beast/example -j3
51+
- b2 --debug-configuration variant=release cxxstd=17 address-model=64 toolset=msvc-14.1 --verbose-test libs/beast/test//run-fat-tests -j3
5252

5353
cache:
5454
- c:\tools\vcpkg\installed\

azure-pipelines.yml

-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
CXX: g++-9
4343
PACKAGES: g++-9
4444
VARIANT: release
45-
B2_FLAGS: <define>BOOST_BEAST_USE_STD_STRING_VIEW
4645
CXXSTD: 17
4746
B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example
4847
GCC 9 C++11 HEADER_ONLY NO_DEPRECATED:
@@ -86,7 +85,6 @@ jobs:
8685
CXX: g++-8
8786
PACKAGES: g++-8
8887
VARIANT: release
89-
B2_FLAGS: <define>BOOST_BEAST_USE_STD_STRING_VIEW
9088
CXXSTD: 17
9189
B2_TARGETS: libs/beast/test//run-fat-tests libs/beast/example
9290
GCC 8 C++11 HEADER_ONLY NO_DEPRECATED:
@@ -303,13 +301,11 @@ jobs:
303301
MSVC14.2 C++17 x64:
304302
VM_IMAGE: 'windows-2019'
305303
TOOLSET: msvc-14.2
306-
B2_FLAGS: define=BOOST_BEAST_USE_STD_STRING_VIEW
307304
CXXSTD: 17
308305
ADDRMODEL: 64
309306
MSVC14.1 C++17 x64:
310307
VM_IMAGE: 'vs2017-win2016'
311308
TOOLSET: msvc-14.1
312-
B2_FLAGS: define=BOOST_BEAST_USE_STD_STRING_VIEW
313309
CXXSTD: 17
314310
ADDRMODEL: 64
315311
MSVC14.0 C++11 x64:

doc/qbk/03_core/8_conf_macros.qbk

-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ failure to do so may result in violations of ODR (One Definition Rule).
1818

1919
[table Special Fields
2020
[[Definition][Description]]
21-
[
22-
[
23-
BOOST_BEAST_USE_STD_STRING_VIEW
24-
][
25-
Causes Beast to use std::string_view instead of boost::string_view.
26-
Requires C++17.
27-
]
28-
]
2921
[
3022
[
3123
BOOST_BEAST_SEPARATE_COMPILATION

doc/qbk/release_notes.qbk

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
[*Miscellaneous]
1717

18+
* [issue 2363] Remove `BOOST_BEAST_USE_STD_STRING_VIEW`
1819
* [issue 2417] use boost::core::string_view. This improves inter-conversion between string_view implementations. Some observable differences for users:
1920
* `core::string_view` no longer supports the `.to_string()` or `.clear()` extensions from Utility
2021
* code that relied on `.max_size()` returning `.size(),` needs to be fixed to use `.size()` instead

include/boost/beast/core/string_type.hpp

+5-15
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,22 @@
1212

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

15-
#if defined(BOOST_BEAST_USE_STD_STRING_VIEW)
16-
#include <string_view>
17-
#else
1815
#include <boost/core/detail/string_view.hpp>
16+
#if defined(BOOST_BEAST_USE_STD_STRING_VIEW)
17+
#include <boost/config/pragma_message.hpp>
18+
BOOST_PRAGMA_MESSAGE("BOOST_BEAST_USE_STD_STRING_VIEW is deprecated, use BOOST_NO_CXX17_HDR_STRING_VIEW instead");
1919
#endif
2020

2121
namespace boost {
2222
namespace beast {
2323

24-
#if BOOST_BEAST_DOXYGEN || ! defined(BOOST_BEAST_USE_STD_STRING_VIEW)
2524
/// The type of string view used by the library
2625
using string_view = boost::core::string_view;
2726

2827
/// The type of `basic_string_view` used by the library
29-
template<class CharT, class Traits>
28+
template<class CharT>
3029
using basic_string_view =
31-
boost::basic_string_view<CharT, Traits>;
32-
33-
#else
34-
using string_view = std::string_view;
35-
36-
template<class CharT, class Traits>
37-
using basic_string_view =
38-
std::basic_string_view<CharT, Traits>;
39-
40-
#endif
30+
boost::core::basic_string_view<CharT>;
4131

4232
template<class S>
4333
inline string_view

0 commit comments

Comments
 (0)