chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.94k stars 1.22k forks source link

Cannot use both any_completion_handler and consign #1202

Open upsilona opened 1 year ago

upsilona commented 1 year ago

Hello!

I'm experementing new features of asio (using boost 1.81.0) and I noticed it's not possible to combine any_completion_handler with consign, as an exemple the following code doest not compile

auto cb = []() { };
auto buffer = std::make_shared<std::uint8_t>();
boost::asio::any_completion_handler<void()> handler_1 = cb; // OK
boost::asio::any_completion_handler<void()> handler_2 = boost::asio::consign(cb, buffer); // NOT OK

producting the error Type 'boost::asio::consign_t<(lambda at ...)>' does not provide a call operator

It would be great to be able to combine both!