Skip to content

exec::fork_join following a continues_on does not compile #1823

@romintomasetti

Description

@romintomasetti

The following code does not compile as of 624efd6:

  TEST_CASE("fork_join following a continues_on", "[adaptors][fork_join]") {
    std::atomic<int> witness = 0;

    auto make_then = [&witness]() {
      return ::STDEXEC::then([&witness]() noexcept { ++witness; });
    };

    auto sndr = ::STDEXEC::just() | ::STDEXEC::continues_on(::STDEXEC::inline_scheduler{})
              | exec::fork_join(make_then(), make_then());

    ::STDEXEC::sync_wait(std::move(sndr));

    CHECK(witness == 2);
  }

I think the code is theoretically valid. Starting with ::STDEXEC::schedule(::STDEXEC::inline_scheduler{}) is fine though.

Here is the compiler output.

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