-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use boost::core::string_view #2417
Comments
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 .size() instead - remove_suffix() and remove_prefix() were more lenient than the standard specs; be sure you don't rely on it clamping the argument to valid range - BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS no longer suppresses conversions to std::string - core::string_view adds .contains() and various bugs fixed This also revealed several bugs against Boost Utility, and two feature requests for Boost Core
I've created a whole slew of test-cases to excavate differences between various implementations. These are not up to standard for inclusion, but perhaps someone sees some useful bits? Goggles advised: https://github.com/sehe/beast/blob/core_string_view/test/beast/core/string.cpp Note it uses c++17 for brevity - not in the last place to be able to compare with c++17 std::string_view, but liberally using contexpr and traits that are specific to c++17. Differences between implementations that might be observed are marked OBSERVABLE |
@vinniefalco Just realized another loose end: despite
The latter are a shame. They circle back to your discussion about custom buffer types in boost-http somewhat. No regression or impact from the issue, just something we might want a solution to. |
Status:
|
What does "land" mean here? |
What are we supposed to do about |
The goal of this ticket is to make beast::string_view more compatible with std::string_view. Both these free functions are std::string_view features, but not compatible with core::string_view. I'm just asking in case I'm missing some fancy way to address these? |
@pdimov "landing a ticket" means when it ships in the next release (it will merge to master, basically). Wasn't aware that was company specific lingo :/ |
It has been merged to master. Next release, well that's another story. We can't change |
What the heck is |
It's a manipulator that quotes strings on op<< and unquotes them on op>>. https://godbolt.org/z/3srYsno9K |
@pdimov That's awesome. Yeah, I had expected the merge to be visible on boostorg/core#110 but that wasn't a PR in the first place. Are you saying that things that are on master do not /automatically/ get pulled into the superproject next release? |
Yes, whatever's on master automatically goes into the next release. But the release itself is months from now. |
That's fine, the Beast change would be in the same release. As long as they go together or in the right order, I'm not in a hurry. |
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 .size() instead - remove_suffix() and remove_prefix() were more lenient than the standard specs; be sure you don't rely on it clamping the argument to valid range - BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS no longer suppresses conversions to std::string - core::string_view adds .contains() and various bugs fixed
fix boostorg#2417 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 .size() instead - remove_suffix() and remove_prefix() were more lenient than the standard specs; be sure you don't rely on it clamping the argument to valid range - BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS no longer suppresses conversions to std::string - core::string_view adds .contains() and various bugs fixed
fix boostorg#2417 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 .size() instead - remove_suffix() and remove_prefix() were more lenient than the standard specs; be sure you don't rely on it clamping the argument to valid range - BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS no longer suppresses conversions to std::string - core::string_view adds .contains() and various bugs fixed
Boost Beast 1.80 switches from boost::string_view to boost::core::string_view [1][2], and thus the "to_string()" method to convert to std::string is not available anymore. Both the old and the new string_view types used support converting to std::string via operator, hence switch to a static_cast to do the conversion. This supports building with all the versions of boost. [1] https://www.boost.org/doc/libs/release/libs/beast/doc/html/beast/release_notes.html [2] boostorg/beast#2417
We should use
boost::core::string_view
instead ofboost::utility::string_view
, because it has better interoperability withstd::string_view
. However, before we make this change public we need to write a short matrix of tests that mix the three principle string views and the standard stringstd::string
,std::string_view
,boost::utility::string_view
,boost::core::string_view
in order to understand what compatibility problems users may experience (if any).The text was updated successfully, but these errors were encountered: