Skip to content

Question about coro::when_all result #434

@Toilettrauma

Description

@Toilettrauma

Hi! When I use coro::when_all and then calling return_value() with std::move the result is l-value reference.
Like in this piece of code on MSVC:

  auto test_coro = [](std::string val) -> coro::task<std::string> {
    co_return val;
  };
  auto [task1, task2] = co_await coro::when_all(
    test_coro("blabla"),
    test_coro("bleh")
  );

  decltype(auto) result_from_1 = std::move(task1).return_value();

The type of result_from_1 is std::string&. Shouldn't it be std::string&&?
Or do I just need to move the value instead?

  decltype(auto) result_from_2 = std::move(task2.return_value());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions