It had to be done - Abusing co_await for optionals—redditsoaddicting

Save to:
Instapaper Pocket Readability

The future is not here yet that it's already full of resources!

It had to be done - Abusing co_await for optionals

by redditsoaddicting

From the article:

I finally got around to playing with coroutines in the context of non-future types. I always guessed this could be done. For optionals specifically, the idea is that you do auto x = co_await foo(); and either x is the value in the optional or the function immediately returns an empty optional...

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.