Skip to content

Commit f6a25c5

Browse files
committed
fix: compilation with gcc/C++20
For some reason there is a weird template instantiation that breaks with the lambda auto parameter.
1 parent e72eafc commit f6a25c5

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/connection_handler.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,21 @@ void AsioConnectionHandler::connect(const AMQP::Address& address)
118118

119119
void AsioConnectionHandler::connect(asio::ip::tcp::resolver::iterator endpoint_iterator)
120120
{
121-
asio::async_connect(this->underlying_socket(), endpoint_iterator, asio::ip::tcp::resolver::iterator(),
122-
[this](const auto& error, auto successful_endpoint) {
123-
if (error)
124-
{
125-
log::error("[{}] Failed to connect to: {}", name_, error.message());
126-
this->onError("Connect failed");
127-
return;
128-
}
129-
log::debug("[{}] Established connection to {} at {}", name_,
130-
successful_endpoint->host_name(),
131-
successful_endpoint->endpoint());
132-
133-
this->handshake(successful_endpoint->host_name());
134-
});
121+
asio::async_connect(
122+
this->underlying_socket(), endpoint_iterator, asio::ip::tcp::resolver::iterator(),
123+
[this](const std::error_code& error,
124+
asio::ip::tcp::resolver::iterator successful_endpoint) {
125+
if (error)
126+
{
127+
log::error("[{}] Failed to connect to: {}", name_, error.message());
128+
this->onError("Connect failed");
129+
return;
130+
}
131+
log::debug("[{}] Established connection to {} at {}", name_,
132+
successful_endpoint->host_name(), successful_endpoint->endpoint());
133+
134+
this->handshake(successful_endpoint->host_name());
135+
});
135136
}
136137

137138
void PlainConnectionHandler::handshake(const std::string& hostname)

0 commit comments

Comments
 (0)