-
Notifications
You must be signed in to change notification settings - Fork 634
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
basic_stream's (websocket::stream) async_connect compilation (type not convertible) failure introduced between Boost 1.85.0 and Boost 1.86.0 #2936
Comments
This appears to be an issue in Asio, as the following code fails to compile: boost::asio::async_connect(
boost::beast::get_lowest_layer(*stream_).socket(),
results,
[](auto ec, auto endpoint) { onConnect(ec, endpoint); }); A workaround is to add a trailing return type to the lambda, which ensures that the boost::asio::async_connect(
boost::beast::get_lowest_layer(*stream_).socket(),
results,
[](auto ec, auto endpoint) -> void { onConnect(ec, endpoint); });
|
Sorry, I don't fully follow-- I mean, yes, but the example you provided that fails to compile fails in both 1.85 and 1.86. The example I provided only fails in 1.86, they appear to be related examples but the semantics are different? The notable thing is the lambda's template The odder thing is... I'm a bit surprised that explicitly specifying the return type is another valid workaround. |
Chris added the |
Version of Beast
Boost 1.86.0
Steps necessary to reproduce the problem
Sample code and godbolt (yes I know this minimum example is contrived, but I don't
want to share awful codeknow what's intellectual property and what isn't in this section of the codebase).Simple "solution" is to change
auto endpoint
toboost::asio::ip::tcp::resolver::results_type::endpoint_type
... but I have absolutely no idea if this changes function generation / execution compared to what's intended; it appears as though this is a mixed Asio/Beast bug. Reduced to a few commits in Boost Asio / Boost Beast, specifically:Asio had no release notes available in the Boost release, I suspect this is a case of "Asio changed a default, Beast changed [to fix ambiguity in #2867 via #2893] but introduced a different behavior change by accident."
All relevant compiler information
I can't think of anything that is particularly relevant, but GCC 13.3 (or 14.2);
-std=c++26
is enough to trigger this.The text was updated successfully, but these errors were encountered: