[Feature] Support for C++20 coroutines
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- developer-experience
Research direction
Start in handle_error.hpp at try_handle_all and try_handle_some, then inspect the related error-handling functions and result type behavior. Determine the coroutine and Awaitable requirements described in the issue; done means C++20 coroutine callers can use the try and error-handling APIs with the requested return syntax.
Written by the indexing model from the issue text.
Description
To use this library with C++20 coroutine the call in handle_error.hpp - try_handle_all or try_handle_some:
if( auto r = std::forward<TryBlock>(try_block)() )
Should check whether the returned time is an Awaitable and use
if( auto r = co_await std::forward<TryBlock>(try_block)() )
instead. Similarly for the error handling functions. This would allow users to write code among the lines of:
boost:leaf::try_handle_some(
[]() -> boost::asio::awaitable<boost:leaf::result<void>> {
co_return boost::leaf::result<void>{};
}, ...);
which is currently not possible. Maybe we could even achieve less verbosity. Ideally I would want to write co_return {}; just like before, but I think boost::leaf::result<> would need a constructor that takes an initializer_list then.
- Dominant language
- C++
- Stars
- 339
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·