Use core::string_view directly instead of alias#3058
Use core::string_view directly instead of alias#3058ssam18 wants to merge 15 commits intoboostorg:developfrom
Conversation
|
An automated preview of the documentation is available at https://3058.beast.prtest.cppalliance.org/libs/beast/doc/html/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-04-02 14:32:41 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3058 +/- ##
========================================
Coverage 93.29% 93.29%
========================================
Files 177 177
Lines 13742 13742
========================================
Hits 12821 12821
Misses 921 921
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
Thank you. Could you please check the |
|
This is great! |
24c3156 to
8b0bb38
Compare
|
Thank you @ashtum for the review! I've updated the PR to:
|
8b0bb38 to
629d37d
Compare
|
Thank you for the detailed review! I've addressed all the feedback:
|
|
Fixed all remaining comment alignment issues. |
|
@ssam18 You can use the GitHub Action CI in your own fork to address the compile errors, since it won’t require approval to run each time. |
Use fully qualified boost::core::string_view instead of core::string_view or beast::string_view to ensure correct namespace resolution in nested boost::beast namespace contexts. This fixes compilation errors across all platforms where the compiler was looking for non-existent types like boost::beast::core::string_view. Fixes CI compilation failures in PR boostorg#3058.
|
Why the core::string_view → boost::core::string_view change is necessary? The issue: C++ namespace lookup rules mean that when you write core::string_view in a file, the compiler searches for core starting from the current namespace and working outward. This works fine in files already inside namespace boost { ... } because the compiler finds boost::core. But in standalone example and test files that aren't wrapped in the boost namespace, the compiler can't find core at all. FIX: Files need to use the fully qualified name boost::core::string_view unless they're already inside the boost namespace. This is why: Example files (like example/http/server/async/http_server_async.cpp) → Need boost::core::string_view (standalone programs) |
|
@ashtum Please let me know if this PR looks good? |
All files under For example: namespace beast = boost::beast; // from <boost/beast.hpp>
namespace http = beast::http; // from <boost/beast/http.hpp>
namespace websocket = beast::websocket; // from <boost/beast/websocket.hpp>
namespace net = boost::asio; // from <boost/asio.hpp>
namespace ssl = boost::asio::ssl; // from <boost/asio/ssl.hpp>
namespace core = boost::core; // from <boost/core/detail/string_view.hpp>
using tcp = boost::asio::ip::tcp; // from <boost/asio/ip/tcp.hpp>Please review each changed line manually and use your judgment to fix any formatting, clarity, or semantic issues. |
Use fully qualified boost::core::string_view instead of core::string_view or beast::string_view to ensure correct namespace resolution in nested boost::beast namespace contexts. This fixes compilation errors across all platforms where the compiler was looking for non-existent types like boost::beast::core::string_view. Fixes CI compilation failures in PR boostorg#3058.
987e58b to
a0031df
Compare
Replaced all uses of string_view and basic_string_view with core::string_view and core::basic_string_view respectively throughout the codebase. Closes boostorg#3046
Use fully qualified boost::core::string_view instead of core::string_view or beast::string_view to ensure correct namespace resolution in nested boost::beast namespace contexts. This fixes compilation errors across all platforms where the compiler was looking for non-existent types like boost::beast::core::string_view. Fixes CI compilation failures in PR boostorg#3058.
This fixes macOS compilation errors where the compiler couldn't resolve the unqualified string_view type in iterator declarations.
…ace and fix comment alignment
…tring_view The test/doc files are not inside the boost namespace, so they need the fully qualified boost::core::string_view instead of core::string_view. Changed back to boost::core::string_view in all affected test/doc files.
…ring_view Example files are standalone programs not inside the boost namespace, so they require the fully qualified boost::core::string_view. Updated all example files except those in example/doc/ which are already inside the boost namespace.
Remove boost:: prefix from core::string_view in implementation files (.ipp) where code is already inside the boost namespace. This makes the code cleaner and follows the project's namespace usage conventions. Also reverted unintended change to release notes as requested by maintainer. Signed-off-by: Samaresh Kumar Singh <ssam3003@gmail.com>
Replace boost::core::string_view with core::string_view throughout example and test/doc directories. Add namespace alias declarations 'namespace core = boost::core;' following project style guidelines.
- Add `namespace core = boost::core;` to test/fuzz files that used `core::string_view` without it being in scope (compilation failure) - Revert release_notes.qbk change (reviewers: please don't modify that) - Fix comment style: `// <boost/core/detail/string_view.hpp>` → `// from <boost/beast.hpp>` in all test/doc and example files - Move `namespace core` before `using tcp` declarations in example files where it was incorrectly placed after - Fix alignment of `namespace core` comment to match surrounding lines
write_string() uses core::string_view at doc_core_snippets namespace scope, but namespace core was only declared inside fxx(). namespace net works globally because config.hpp defines it at global scope; core needs an equivalent declaration. Add it at file scope alongside the existing using namespace boost::beast.
a0031df to
48130a7
Compare
libs/regex depends on libs/static_assert via Boost.Build, but it was missing from the Windows CI submodule checkout, causing all MSVC builds to fail with 'could not resolve project reference /boost/static_assert'.
|
@vinniefalco vinniefalco after a long chase, I was able to fix all the failing tests after addressing the review comments. Please take a look at this PR. |
This PR addresses issue #3046 by replacing all uses of the
string_viewalias withcore::string_viewthroughout the codebase for improved clarity in both documentation and source code.Changes
string_viewwithcore::string_viewin all header files (.hpp)string_viewwithcore::string_viewin all inline implementation files (.ipp)core::string_viewbasic_string_viewwithcore::basic_string_viewwhere applicablestring_type.hppfor backward compatibilityBenefits
boost::core::string_viewFiles Modified
Closes #3046