Lazy Generation of Random Sequence

Seb via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 26 10:41:39 PDT 2016


On Tuesday, 26 April 2016 at 17:38:33 UTC, Nordlöw wrote:
> On Tuesday, 26 April 2016 at 11:09:42 UTC, Seb wrote:
>> Btw if you do random generation at the moment, you should 
>> always be aware that it's super-easy to do an implicit copy if 
>> you pass around the rndGen
>
> So should I pass it by ref or const ref then?

I guess both work fine, but this was just a warning for other 
case.
The example that @WebDrake mentioned on his slides can happen too 
easily - a reason why we should fix it (which is on my agenda).


More information about the Digitalmars-d-learn mailing list