lewissbaker / cppcoro

A library of C++ coroutine abstractions for the coroutines TS
MIT License
3.43k stars 472 forks source link

Add [[nodiscard]] to awaitables #104

Closed joemalle closed 5 years ago

joemalle commented 5 years ago

Currently there is no warning if you call a function that returns an awaitable but don't call co_await. At best, there is a runtime diagnostic. Adding [[nodiscard]] to the awaitable types would make the compiler warn about these mistakes.

I can make a PR if this seems reasonable to you.

boimart1 commented 5 years ago

I've asked before on the cpp slack: image