Is there any reason to use non-ref foreach?

James Blachly james.blachly at gmail.com
Fri Aug 31 16:50:41 UTC 2018


On Friday, 31 August 2018 at 12:52:17 UTC, bauss wrote:
>
> So basically ... Instead of copying the value, you're just 
> copying the address.
>
> I can't see the benefit other than added complexity.

I assume a benefit could be observed if you are copying a large 
struct instead of an int.


More information about the Digitalmars-d-learn mailing list