Yield, Not Return By Reference

no-email (Damien Seguy), Damien Seguy
Fri, 16 Feb 2024 00:00:00 +0000

When a method returns a reference, there is a ``&`` before its name, in the signature. This means that the function must return a variable, or a property, and not a literal value.
When the same ``&`` is added on a generator, this now means that the yielded values are by reference. On the other hand, the returned value mat be a literal value, without generating a warning.