called copy constructor in foreach with ref on Range

kinke noone at nowhere.com
Mon Jun 22 19:41:34 UTC 2020


On Monday, 22 June 2020 at 19:03:44 UTC, Jonathan M Davis wrote:
> in practice, that means that generic code cannot use a range 
> once it's been copied

Translating to a simple rule-of-thumb: never copy a (struct) 
range, always move.


More information about the Digitalmars-d-learn mailing list