Skip to content

basic_stream's (websocket::stream) async_connect compilation (type not convertible) failure introduced between Boost 1.85.0 and Boost 1.86.0 #2936

@13steinj

Description

@13steinj

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 code know what's intellectual property and what isn't in this section of the codebase).

#include <boost/beast/core.hpp>
#include <boost/beast/websocket.hpp>

namespace bb = boost::beast;

extern boost::beast::websocket::stream<boost::beast::tcp_stream>* stream_;
extern void onConnect(boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type::endpoint_type);

void onResolve(boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type results) {
    boost::beast::get_lowest_layer(*stream_).async_connect(
        results, [](auto ec, auto endpoint) { onConnect(ec, endpoint); });
}

Simple "solution" is to change auto endpoint to boost::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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions