Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement co_await operator for single yaclib::Future #194

Closed
Tracked by #187
MBkkt opened this issue Aug 9, 2022 · 0 comments
Closed
Tracked by #187

Implement co_await operator for single yaclib::Future #194

MBkkt opened this issue Aug 9, 2022 · 0 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@MBkkt
Copy link
Member

MBkkt commented Aug 9, 2022

First of feel free to ask me(@MBkkt) any questions about this task, often the task may not be described in enough detail for devs who don't have the full context.

Implement co_await operator, for single future, that consume future by rvalue reference and await it (yaclib::Await) and return result from it in await_resume

Now we need to write something like this:

  yaclib::Future<int> f = ...;
  co_await Await(f);
  co_return std::move(f).Touch/Get();

We want to make operators to simplify it:

template<typename T>
yaclib::Result<T> operator co_await(yaclib::Future<T>&&);
template<typename T>
yaclib::Result<T> operator co_await(yaclib::FutureOn<T>&&);

If we will have it, we can write:

  yaclib::Future<int> f = ...;
  co_return co_await std::move(f);
@MBkkt MBkkt added the good first issue Good for newcomers label Aug 9, 2022
@MBkkt MBkkt changed the title Also will be great if you implement co_await operator, for single future, that consume future by rvalue reference and await it (yaclib::Await) and return result from it in await_resume Implement co_await operator for single yaclib::Future Aug 9, 2022
@MBkkt MBkkt added this to the Not main priority milestone Aug 9, 2022
MBkkt added a commit that referenced this issue Jan 26, 2023
@MBkkt MBkkt closed this as completed Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants