Skip to content

[v2] error: overloaded process constructor if passing an executor #313

Description

@rbrugo

In the following code the first process constructor succeeds, the second fails:

#include <boost/asio/awaitable.hpp>
#include <boost/process/v2.hpp>

void ok()
{
    auto ctx = boost::asio::io_context{};
    boost::process::v2::process(ctx, "", {});
}

auto fail() -> boost::asio::awaitable<void>
{
    auto ex = co_await boost::asio::this_coro::executor;
    boost::process::v2::process(ex, "", {});
}

With the error:

call of overloaded 'basic_process(boost::asio::any_io_executor&, const char [1], <brace-enclosed initializer list>)' is ambiguous
note: candidate: 'boost::process::v2::basic_process<Executor>::basic_process(executor_type, const boost::filesystem::path&, std::initializer_list<boost::basic_string_view<wchar_t, std::char_traits<wchar_t> > >, Inits&& ...) [with Inits = {}; Executor = boost::asio::any_io_executor; executor_type = boost::asio::any_io_executor]'
note: candidate: 'boost::process::v2::basic_process<Executor>::basic_process(executor_type, const boost::filesystem::path&, std::initializer_list<boost::basic_string_view<char, std::char_traits<char> > >, Inits&& ...) [with Inits = {}; Executor = boost::asio::any_io_executor; executor_type = boost::asio::any_io_executor]'

Compiler explorer: https://gcc.godbolt.org/z/sddfdo64s

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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