Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion include/exec/start_detached.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ namespace experimental::execution
{
auto __env2 = STDEXEC::__as_root_env(static_cast<_Env&&>(__env));
using __domain_t = __compl_domain_t<_Sender, STDEXEC::__as_root_env_t<_Env>>;
STDEXEC::apply_sender(__domain_t{}, *this, static_cast<_Sender&&>(__sndr), __env2);
STDEXEC::apply_sender(__domain_t{},
*this,
static_cast<_Sender&&>(__sndr),
static_cast<decltype(__env2)&&>(__env2));
}

// Below is the default implementation for `start_detached`.
Expand Down
13 changes: 13 additions & 0 deletions test/exec/test_start_detached.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,19 @@ namespace
struct env
{};

struct move_only_env
{
move_only_env() = default;
move_only_env(move_only_env&&) noexcept = default;
move_only_env(move_only_env const &) = delete;
};

TEST_CASE("start_detached works with a move-only environment",
"[consumers][start_detached]")
{
exec::start_detached(ex::just(), move_only_env{});
}

TEST_CASE("ex::on can be passed to start_detached with env", "[adaptors][ex::on]")
{
ex::run_loop loop;
Expand Down
Loading