NVIDIA/stdexec

transfer_when_all simple example query

prlw1 opened this issue · 1 comments

I converted the test case

  TEST_CASE("transfer_when_all simple example", "[adaptors][transfer_when_all]") {
    auto snd = ex::transfer_when_all(inline_scheduler{}, ex::just(3), ex::just(0.1415));
    auto snd1 = std::move(snd) | ex::then([](int x, double y) { return x + y; });
    auto op = ex::connect(std::move(snd1), expect_value_receiver{3.1415});
    ex::start(op);
  }

into what I thought was the standalone equivalent

#include <stdexec/execution.hpp>
#include <exec/static_thread_pool.hpp>

int main()
{
        exec::static_thread_pool pool{};
        stdexec::scheduler auto sched = pool.get_scheduler();
        auto snd = stdexec::transfer_when_all(sched, stdexec::just(3), stdexec::just(0.1415));
        auto snd1 = std::move(snd) | stdexec::then([](int x, double y) { return x + y; });
        auto [res] = stdexec::sync_wait(std::move(snd1));
}

but get the following compilation error

#   compile  when_all/when_all.o
c++  -O2 -fPIE -g -Werror -std=c++23     -I/usr/src/local/stdexec/include  -c    when_all.cc
when_all.cc: In function ‘int main()’:
when_all.cc:10:56: error: ‘std::_Optional_base<std::tuple<double>, true, false>’ is an inaccessible base of ‘std::optional<std::tuple<double> >’
   10 |         auto [res] = stdexec::sync_wait(std::move(snd1));
      |                                                        ^
*** Error code 1

with gcc 12.4.0 and 15.0.0 20240822

What am I missing?

answer: the .value()
sorry for the noise