diff --git a/.drone.star b/.drone.star index 81dbaece0d..c424983d92 100644 --- a/.drone.star +++ b/.drone.star @@ -56,9 +56,9 @@ def main(ctx): 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), osx_cxx("clang", "g++", packages="", buildtype="boost", buildscript="drone", environment={'B2_TOOLSET': 'clang', 'B2_CXXSTD': '11,17', 'DRONE_JOB_UUID': '91032ad7bb'}, globalenv=globalenv), linux_cxx("coverity", "g++", packages="", buildtype="coverity", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'Coverity Scan', 'B2_TOOLSET': 'clang', 'DRONE_JOB_UUID': '472b07b9fc'}, globalenv=globalenv), - 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"}), - 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"}), - 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"}), + windows_cxx("msvc-14.1", "", image="cppalliance/dronevs2017", buildtype="boost", buildscript="drone", environment={ "VARIANT": "release", "TOOLSET": "msvc-14.1", "CXXSTD": "17", "ADDRESS_MODEL": "64"}), + windows_cxx("msvc-14.2", "", image="cppalliance/dronevs2019", buildtype="boost", buildscript="drone", environment={ "VARIANT": "release", "TOOLSET": "msvc-14.2", "CXXSTD": "17", "ADDRESS_MODEL": "64"}), + 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"}), ] # from https://github.com/boostorg/boost-ci diff --git a/.drone/drone.bat b/.drone/drone.bat index deca8ea501..780247d77e 100755 --- a/.drone/drone.bat +++ b/.drone/drone.bat @@ -22,16 +22,18 @@ b2 headers echo "============> SCRIPT" +IF DEFINED DEFINE SET B2_DEFINE="define=%DEFINE%" + echo "Running tests" -b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% define=%DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test -j3 +b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test -j3 if !errorlevel! neq 0 exit /b !errorlevel! echo "Running libs/beast/example" -b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% define=%DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% libs/beast/example -j3 +b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% libs/beast/example -j3 if !errorlevel! neq 0 exit /b !errorlevel! echo "Running run-fat-tests" -b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% define=%DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test//run-fat-tests -j3 +b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test libs/beast/test//run-fat-tests -j3 if !errorlevel! neq 0 exit /b !errorlevel! echo "============> COMPLETED" diff --git a/CHANGELOG.md b/CHANGELOG.md index 098a6068b6..5b12ca4a53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +Version 339: + +* BOOST_BEAST_USE_STD_STRING_VIEW is replaced by boost/core string_view. +* defining BOOST_BEAST_USE_STD_STRING_VIEW yields a deprecation warning + +-------------------------------------------------------------------------------- + + Version 338: * Added per message compression options. diff --git a/appveyor.yml b/appveyor.yml index ebe44c39b0..9441da2ce9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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\ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 948158dfdc..840acaf508 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,7 +42,6 @@ jobs: CXX: g++-9 PACKAGES: g++-9 VARIANT: release - B2_FLAGS: 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: @@ -86,7 +85,6 @@ jobs: CXX: g++-8 PACKAGES: g++-8 VARIANT: release - B2_FLAGS: 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: @@ -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: diff --git a/doc/qbk/03_core/8_conf_macros.qbk b/doc/qbk/03_core/8_conf_macros.qbk index 63e9c758be..daea30de4a 100644 --- a/doc/qbk/03_core/8_conf_macros.qbk +++ b/doc/qbk/03_core/8_conf_macros.qbk @@ -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 diff --git a/doc/qbk/release_notes.qbk b/doc/qbk/release_notes.qbk index 68b2b37002..e60010180e 100644 --- a/doc/qbk/release_notes.qbk +++ b/doc/qbk/release_notes.qbk @@ -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 diff --git a/include/boost/beast/core/string_type.hpp b/include/boost/beast/core/string_type.hpp index 48cb0114f6..bbb09db809 100644 --- a/include/boost/beast/core/string_type.hpp +++ b/include/boost/beast/core/string_type.hpp @@ -12,32 +12,22 @@ #include -#if defined(BOOST_BEAST_USE_STD_STRING_VIEW) -#include -#else #include +#if defined(BOOST_BEAST_USE_STD_STRING_VIEW) +#include +BOOST_PRAGMA_MESSAGE("BOOST_BEAST_USE_STD_STRING_VIEW is deprecated, use BOOST_NO_CXX17_HDR_STRING_VIEW instead"); #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 +template using basic_string_view = - boost::basic_string_view; - -#else -using string_view = std::string_view; - -template -using basic_string_view = - std::basic_string_view; - -#endif + boost::core::basic_string_view; template inline string_view