lewissbaker / cppcoro

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

final_suspend is required to be non-throwing #157

Open Kyle-Thompson opened 4 years ago

Kyle-Thompson commented 4 years ago

I'm using this project running off the master branch in a pet project of mine and compiling with clang on the latest version of master. When attempting to compile I get the following error

/.../cppcoro/include/cppcoro/generator.hpp:36:83: note: must be declared with 'noexcept'
                        constexpr std::experimental::suspend_always final_suspend() const { return {}; }

Making this function noexcept solved the problem but this seems odd to me. If the correct solution was to just add noexcept I'd assume that it would already be there. Is this a bug or am I just doing something wrong?

mellester commented 4 years ago

it seems like this is a requirement which was only added later to the compiler.

Kyle-Thompson commented 4 years ago

Is this something that can be patched in now or is there no plan to support this requirement until later?