Open ChrisGuzak opened 4 years ago
Editors call: The Guidelines currently target C++17, and coroutines are in C++20 which is not yet published. The Guidelines document consensus experience and guidance, so once C++20 is used in the field we will look at adding guidance for coroutines.
Thanks to #1756 there is now a coroutine rule section, feel free to add!
Editors call: Now that we're open for business for coroutines, we're reopening this... could you please submit a PR for a new guideline as you describe, with succinct rationale and bad/good examples, similar in format to the new CP.51 we just added, and make it CP.52? Thanks!
When passing values to functions that use co-routines those functions need to ensure they don't access values by reference in the continuation. This means parameter choice pushes you do taking things by value, for example a RECT class (4 numbers) is often best passed by
const&
but if it needs to be used after the suspension point by value is better.Should this be discussed in F.16?