Skip to content

Windows Visual Studio 2022 C++17/C++20 failed compilation of src.hpp. #177

Closed
@RayDavidWhitmer

Description

@RayDavidWhitmer

I am working in recent download of visual studio 2022. I tried the following with permissive option true in C++17 and C++ 20 modes.

This all happens before I have tried to use redis or asio in any way other than including boost/redis/src.hpp. I would be happy with some sort of work-around. Is it a VS error I should report there, or something else?

I downloaded prebuilt 1.84 windows binaries from the linked source on boost.org with inclusion tree, added to the include path and supplied the boost::redis mandatory openssl dependency.

I created a brief .cpp file that includes boost/redis/src.hpp.

Upon compilation, I get the error:
'boost::redis::basic_connectionboost::redis::connection::executor_type::basic_connection': no overloaded function could convert all the argument types C:\Users\rwhitmer\foo\esc\boost\boost\redis\impl\connection.ipp 22

The line in question is:

impl_{ioc.get_executor(), method, max_read_size}

According to VS, ioc.get_executor() returns boost::asio::io_context::executor_type and the constructor requires something different something with a name like, asio::any_*_executor and unconvertable.

I look at the class redis/connection.hpp and asio/any_*_executor to try to figure out how this problem arises. I find the documentation of BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT which seems related to this sort of failure, together with documentation of proposed standard executors, etc. Defining this macro changes the error.

The error with the definition is:

Error C2182 'executor_': this use of 'void' is not valid C:\Users\rwhitmer\foo\esc\boost\boost\asio\experimental\impl\parallel_group.hpp 135

The line in question says:

executor_type executor_;

which seems to rely on the typedef on line 88:

typedef decay_t<
prefer_result_t<
associated_executor_t,
execution::outstanding_work_t::tracked_t
>
> executor_type;

The additional information given in the compiler output is:

click to expand

1>C:\Users\rwhitmer\foo\esc\boost\boost\asio\experimental\impl\parallel_group.hpp(135,17): 1>the template instantiation context (the oldest one first) is 1> C:\Users\rwhitmer\foo\esc\boost\boost\redis\impl\connection.ipp(31,9): 1> see reference to function template instantiation 'void boost::redis::basic_connection::async_run>(const boost::redis::config &,Logger,CompletionToken)' being compiled 1> with 1> [ 1> Logger=boost::redis::logger, 1> CompletionToken=boost::asio::any_completion_handler 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\redis\connection.hpp(158,20): 1> see reference to function template instantiation 'void boost::asio::async_compose,boost::asio::basic_waitable_timer,boost::asio::any_io_executor>&>(Implementation &&,boost::asio::any_completion_handler &,boost::asio::basic_waitable_timer,boost::asio::any_io_executor> &)' being compiled 1> with 1> [ 1> CompletionToken=boost::asio::any_completion_handler, 1> Logger=boost::redis::logger, 1> Clock=std::chrono::steady_clock, 1> Implementation=boost::redis::detail::reconnection_op 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\compose.hpp(307,10): 1> see reference to function template instantiation 'void boost::asio::async_initiate,Implementation>(Initiation &&,boost::asio::any_completion_handler &,Implementation &&)' being compiled 1> with 1> [ 1> CompletionToken=boost::asio::any_completion_handler, 1> Signature=void (boost::system::error_code), 1> Implementation=boost::redis::detail::reconnection_op, 1> Initiation=boost::asio::detail::initiate_composed_op 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\async_result.hpp(570,65): 1> see reference to function template instantiation 'boost::asio::detail::completion_handler_async_result::return_type boost::asio::detail::completion_handler_async_result::initiate(Initiation &&,RawCompletionToken &&,Implementation &&)' being compiled 1> with 1> [ 1> CompletionToken=boost::asio::any_completion_handler, 1> Signature=void (boost::system::error_code), 1> Initiation=boost::asio::detail::initiate_composed_op, 1> Implementation=boost::redis::detail::reconnection_op, 1> RawCompletionToken=boost::asio::any_completion_handler 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\async_result.hpp(273,31): 1> see reference to function template instantiation 'void boost::asio::detail::initiate_composed_op::operator ()(Handler &&,Impl &&) const' being compiled 1> with 1> [ 1> Signature=void (boost::system::error_code), 1> RawCompletionToken=boost::asio::any_completion_handler, 1> Implementation=boost::redis::detail::reconnection_op, 1> Handler=boost::asio::any_completion_handler, 1> Impl=boost::redis::detail::reconnection_op 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\compose.hpp(165,35): 1> see reference to function template instantiation 'void boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature>::operator ()<>(void)' being compiled 1> with 1> [ 1> Logger=boost::redis::logger, 1> Executors=void (boost::asio::executor), 1> Signature=void (boost::system::error_code) 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\compose.hpp(92,5): 1> see reference to function template instantiation 'void boost::redis::detail::reconnection_op::operator (),boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature>>(Self &,boost::system::error_code)' being compiled 1> with 1> [ 1> Logger=boost::redis::logger, 1> Executors=void (boost::asio::executor), 1> Signature=void (boost::system::error_code), 1> Self=boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)> 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\redis\connection.hpp(38,22): 1> see reference to function template instantiation 'void boost::redis::detail::connection_base::async_run,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature>>(const boost::redis::config &,Logger,CompletionToken)' being compiled 1> with 1> [ 1> Logger=boost::redis::logger, 1> Executors=void (boost::asio::executor), 1> Signature=void (boost::system::error_code), 1> CompletionToken=boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)> 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\redis\detail\connection_base.hpp(500,21): 1> see reference to function template instantiation 'void boost::redis::detail::runner::async_run,Logger,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature>>(Connection &,Logger,CompletionToken)' being compiled 1> with 1> [ 1> Logger=boost::redis::logger, 1> Executors=void (boost::asio::executor), 1> Signature=void (boost::system::error_code), 1> Connection=boost::redis::detail::connection_base, 1> CompletionToken=boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)> 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\redis\detail\runner.hpp(196,20): 1> see reference to function template instantiation 'void boost::asio::async_compose,Connection,Logger>,Connection&>(Implementation &&,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature> &,Connection &)' being compiled 1> with 1> [ 1> CompletionToken=boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>, 1> Connection=boost::redis::detail::connection_base, 1> Logger=boost::redis::logger, 1> Implementation=boost::redis::detail::runner_op,boost::redis::detail::connection_base,boost::redis::logger>, 1> Executors=void (boost::asio::executor), 1> Signature=void (boost::system::error_code) 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\compose.hpp(307,10): 1> see reference to function template instantiation 'void boost::asio::async_initiate,Implementation>(Initiation &&,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature> &,Implementation &&)' being compiled 1> with 1> [ 1> CompletionToken=boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>, 1> Signature=void (boost::system::error_code), 1> Implementation=boost::redis::detail::runner_op,boost::redis::detail::connection_base,boost::redis::logger>, 1> Initiation=boost::asio::detail::initiate_composed_op, 1> Logger=boost::redis::logger, 1> Executors=void (boost::asio::executor) 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\async_result.hpp(570,65): 1> see reference to function template instantiation 'boost::asio::detail::completion_handler_async_result::return_type boost::asio::detail::completion_handler_async_result::initiate(Initiation &&,RawCompletionToken &&,Implementation &&)' being compiled 1> with 1> [ 1> CompletionToken=boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>, 1> Signature=void (boost::system::error_code), 1> Initiation=boost::asio::detail::initiate_composed_op, 1> Implementation=boost::redis::detail::runner_op,boost::redis::detail::connection_base,boost::redis::logger>, 1> RawCompletionToken=boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)> 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\async_result.hpp(273,31): 1> see reference to function template instantiation 'void boost::asio::detail::initiate_composed_op::operator ()(Handler &&,Impl &&) const' being compiled 1> with 1> [ 1> Signature=void (boost::system::error_code), 1> RawCompletionToken=boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>, 1> Implementation=boost::redis::detail::runner_op,boost::redis::detail::connection_base,boost::redis::logger>, 1> Handler=boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>, 1> Impl=boost::redis::detail::runner_op,boost::redis::detail::connection_base,boost::redis::logger> 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\compose.hpp(165,35): 1> see reference to function template instantiation 'void boost::asio::detail::composed_op,Connection,Logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature>,Signature>::operator ()<>(void)' being compiled 1> with 1> [ 1> Connection=boost::redis::detail::connection_base, 1> Logger=boost::redis::logger, 1> Executors=void (boost::asio::executor), 1> Signature=void (boost::system::error_code) 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\compose.hpp(92,5): 1> see reference to function template instantiation 'void boost::redis::detail::runner_op,Connection,Logger>::operator (),Connection,Logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature>,Signature>>(Self &,std::array,boost::system::error_code,boost::system::error_code,boost::system::error_code,size_t)' being compiled 1> with 1> [ 1> Connection=boost::redis::detail::connection_base, 1> Logger=boost::redis::logger, 1> Executors=void (boost::asio::executor), 1> Signature=void (boost::system::error_code), 1> Self=boost::asio::detail::composed_op,boost::redis::detail::connection_base,boost::redis::logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>,void (boost::system::error_code)> 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\redis\detail\runner.hpp(96,11): 1> see reference to function template instantiation 'void boost::asio::experimental::parallel_group,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::>::async_wait,Connection,Logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature>,Signature>>(CancellationCondition,CompletionToken &&)' being compiled 1> with 1> [ 1> Connection=boost::redis::detail::connection_base, 1> Logger=boost::redis::logger, 1> Executors=void (boost::asio::executor), 1> Signature=void (boost::system::error_code), 1> CancellationCondition=boost::asio::experimental::wait_for_all, 1> CompletionToken=boost::asio::detail::composed_op,boost::redis::detail::connection_base,boost::redis::logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>,void (boost::system::error_code)> 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\experimental\parallel_group.hpp(200,25): 1> see reference to function template instantiation 'void boost::asio::async_initiate,boost::system::error_code,boost::system::error_code,boost::system::error_code),boost::asio::experimental::parallel_group,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::>::initiate_async_wait,boost::asio::experimental::wait_for_all,std::tuple,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::>>(Initiation &&,boost::asio::detail::composed_op,Connection,Logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature>,Signature> &,boost::asio::experimental::wait_for_all &&,std::tuple,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::> &&)' being compiled 1> with 1> [ 1> CompletionToken=boost::asio::detail::composed_op,boost::redis::detail::connection_base,boost::redis::logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>,void (boost::system::error_code)>, 1> Connection=boost::redis::detail::connection_base, 1> Logger=boost::redis::logger, 1> Initiation=boost::asio::experimental::parallel_group,boost::redis::detail::connection_base,boost::redis::logger>::()::,boost::redis::detail::runner_op,boost::redis::detail::connection_base,boost::redis::logger>::()::,boost::redis::detail::runner_op,boost::redis::detail::connection_base,boost::redis::logger>::()::>::initiate_async_wait, 1> Executors=void (boost::asio::executor), 1> Signature=void (boost::system::error_code) 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\async_result.hpp(570,65): 1> see reference to function template instantiation 'boost::asio::detail::completion_handler_async_result,boost::system::error_code,boost::system::error_code,boost::system::error_code)>::return_type boost::asio::detail::completion_handler_async_result,boost::system::error_code,boost::system::error_code,boost::system::error_code)>::initiate,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::>>(Initiation &&,RawCompletionToken &&,boost::asio::experimental::wait_for_all &&,std::tuple,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::> &&)' being compiled 1> with 1> [ 1> CompletionToken=boost::asio::detail::composed_op,boost::redis::detail::connection_base,boost::redis::logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>,void (boost::system::error_code)>, 1> Initiation=boost::asio::experimental::parallel_group,boost::redis::detail::connection_base,boost::redis::logger>::()::,boost::redis::detail::runner_op,boost::redis::detail::connection_base,boost::redis::logger>::()::,boost::redis::detail::runner_op,boost::redis::detail::connection_base,boost::redis::logger>::()::>::initiate_async_wait, 1> Connection=boost::redis::detail::connection_base, 1> Logger=boost::redis::logger, 1> RawCompletionToken=boost::asio::detail::composed_op,boost::redis::detail::connection_base,boost::redis::logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>,void (boost::system::error_code)> 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\async_result.hpp(273,31): 1> see reference to function template instantiation 'void boost::asio::experimental::parallel_group,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::>::initiate_async_wait::operator ()(Handler &&,Condition &&,std::tuple,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::> &&) const' being compiled 1> with 1> [ 1> Connection=boost::redis::detail::connection_base, 1> Logger=boost::redis::logger, 1> RawCompletionToken=boost::asio::detail::composed_op,boost::redis::detail::connection_base,boost::redis::logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>,void (boost::system::error_code)>, 1> Handler=boost::asio::detail::composed_op,boost::redis::detail::connection_base,boost::redis::logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,void (boost::system::error_code)>,void (boost::system::error_code)>, 1> Condition=boost::asio::experimental::wait_for_all 1> ] 1> C:\Users\rwhitmer\foo\esc\boost\boost\asio\experimental\parallel_group.hpp(150,15): 1> see reference to function template instantiation 'void boost::asio::experimental::detail::parallel_group_launch<_Ty,boost::asio::detail::composed_op,Connection,Logger>,boost::asio::detail::composed_work,boost::asio::detail::composed_op,boost::asio::detail::composed_work,boost::asio::any_completion_handler,Signature>,Signature>,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,0,1,2>(Condition,Handler,std::tuple,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::,boost::redis::detail::runner_op,Connection,Logger>::()::

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