Reputation: 1086
I tried the daytime server example for boost::asio asynchronous server using C++23 and the concept requirement fails for the call to bind() for the call async_write() and a type conversion error for async_accept()
https://www.boost.org/doc/libs/1_87_0/doc/html/boost_asio/tutorial/tutdaytime3.html
For async_write()
main.cpp:47:9: No matching function for call to 'async_write'
write.hpp:: candidate template ignored: constraints not satisfied [with AsyncWriteStream = tcp::socket, ConstBufferSequence = mutable_buffers_1, WriteToken = typename _Bind_helper<__is_socketlike<void (tcp_connection::*)(const error_code &, unsigned long)>::value, void (tcp_connection::*)(const error_code &, unsigned long), shared_ptr<tcp_connection>, arg<1> (&)(), arg<2> (&)()>::type]
:564:5: note: because '::boost::asio::completion_token_for<std::_Bind<void (tcp_connection::*(std::shared_ptr<tcp_connection>, boost::arg<1> (*)(), boost::arg<2> (*)()))(const boost::system::error_code &, unsigned long)>, void (boost::system::error_code, std::size_t)>' evaluated to false
async_result.hpp:1214:5: because 'async_initiate<T, Signatures...>(detail::initiation_archetype<Signatures...>{}, t)' would be invalid: no matching function for call to 'async_initiate'
write.hpp:: candidate template ignored: substitution failure [with AsyncWriteStream = tcp::socket, DynamicBuffer_v1 = mutable_buffers_1, WriteToken = typename _Bind_helper<__is_socketlike<void (tcp_connection::*)(const error_code &, unsigned long)>::value, void (tcp_connection::*)(const error_code &, unsigned long), shared_ptr<tcp_connection>, arg<1> (&)(), arg<2> (&)()>::type]: no type named 'type' in 'boost::asio::constraint<false>'
write.hpp:: candidate template ignored: could not match 'boost::asio::basic_streambuf<Allocator>' against 'mutable_buffers_1'
write.hpp:: candidate template ignored: substitution failure [with AsyncWriteStream = tcp::socket, DynamicBuffer_v2 = mutable_buffers_1, WriteToken = typename _Bind_helper<__is_socketlike<void (tcp_connection::*)(const error_code &, unsigned long)>::value, void (tcp_connection::*)(const error_code &, unsigned long), shared_ptr<tcp_connection>, arg<1> (&)(), arg<2> (&)()>::type]: no type named 'type' in 'boost::asio::constraint<false>'
write.hpp:: candidate function template not viable: requires 4 arguments, but 3 were provided
write.hpp:: candidate function template not viable: requires at least 4 arguments, but 3 were provided
write.hpp:: candidate function template not viable: requires at least 4 arguments, but 3 were provided
write.hpp:: candidate function template not viable: requires at least 4 arguments, but 3 were provided
For async_accept()
main.cpp:84:9: No matching member function for call to 'async_accept'
basic_socket_acceptor.hpp:1531:3: candidate function template not viable: no known conversion from 'typename _Bind_helper<__is_socketlike<void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &)>::value, void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &), tcp_server *, shared_ptr<tcp_connection> &, arg<1> (&)()>::type' (aka '_Bind<void (tcp_server::*(tcp_server *, std::shared_ptr<tcp_connection>, boost::arg<1> (*)()))(std::shared_ptr<tcp_connection>, const boost::system::error_code &)>') to 'endpoint_type &' (aka 'basic_endpoint<tcp> &') for 2nd argument
basic_socket_acceptor.hpp:2500:3: candidate function template not viable: no known conversion from 'typename _Bind_helper<__is_socketlike<void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &)>::value, void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &), tcp_server *, shared_ptr<tcp_connection> &, arg<1> (&)()>::type' (aka '_Bind<void (tcp_server::*(tcp_server *, std::shared_ptr<tcp_connection>, boost::arg<1> (*)()))(std::shared_ptr<tcp_connection>, const boost::system::error_code &)>') to 'endpoint_type &' (aka 'basic_endpoint<tcp> &') for 2nd argument
basic_socket_acceptor.hpp:2603:3: candidate function template not viable: no known conversion from 'typename _Bind_helper<__is_socketlike<void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &)>::value, void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &), tcp_server *, shared_ptr<tcp_connection> &, arg<1> (&)()>::type' (aka '_Bind<void (tcp_server::*(tcp_server *, std::shared_ptr<tcp_connection>, boost::arg<1> (*)()))(std::shared_ptr<tcp_connection>, const boost::system::error_code &)>') to 'endpoint_type &' (aka 'basic_endpoint<tcp> &') for 2nd argument
basic_socket_acceptor.hpp:2211:3: candidate function template not viable: no known conversion from 'tcp::socket' (aka 'basic_stream_socket<tcp>') to 'endpoint_type &' (aka 'basic_endpoint<tcp> &') for 1st argument
basic_socket_acceptor.hpp:1398:3: candidate template ignored: constraints not satisfied [with Protocol1 = boost::asio::ip::tcp, Executor1 = boost::asio::any_io_executor, AcceptToken = typename _Bind_helper<__is_socketlike<void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &)>::value, void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &), tcp_server *, shared_ptr<tcp_connection> &, arg<1> (&)()>::type]
:1394:7: note: because '::boost::asio::completion_token_for<std::_Bind<void (tcp_server::*(tcp_server *, std::shared_ptr<tcp_connection>, boost::arg<1> (*)()))(std::shared_ptr<tcp_connection>, const boost::system::error_code &)>, void (boost::system::error_code)>' evaluated to false
async_result.hpp:1214:5: because 'async_initiate<T, Signatures...>(detail::initiation_archetype<Signatures...>{}, t)' would be invalid: no matching function for call to 'async_initiate'
basic_socket_acceptor.hpp:1936:3: candidate template ignored: substitution failure [with Executor1 = tcp::socket, MoveAcceptToken = typename _Bind_helper<__is_socketlike<void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &)>::value, void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &), tcp_server *, shared_ptr<tcp_connection> &, arg<1> (&)()>::type]: no type named 'type' in 'boost::asio::constraint<false>'
basic_socket_acceptor.hpp:2035:3: candidate template ignored: substitution failure [with ExecutionContext = tcp::socket, MoveAcceptToken = typename _Bind_helper<__is_socketlike<void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &)>::value, void (tcp_server::*)(shared_ptr<tcp_connection>, const error_code &), tcp_server *, shared_ptr<tcp_connection> &, arg<1> (&)()>::type]: no type named 'type' in 'boost::asio::constraint<false>'
basic_socket_acceptor.hpp:1679:3: candidate function template not viable: allows at most single argument 'token', but 2 arguments were provided
Upvotes: 0
Views: 54