Skip to content

Commit

Permalink
Slightly tone down warning message about value-type RNGs and Random{C…
Browse files Browse the repository at this point in the history
…over, Sample}.
  • Loading branch information
WebDrake committed Aug 26, 2013
1 parent 98a3efb commit 3bdda60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions std/random.d
Expand Up @@ -1590,7 +1590,7 @@ foreach (e; randomCover(a, Random(unpredictableSeed))) // correct!
writeln(e);
}
foreach (e; randomCover(a, rndGen)) // WRONG!! rndGen gets copied by value
foreach (e; randomCover(a, rndGen)) // DANGEROUS!! rndGen gets copied by value
{
writeln(e);
}
Expand Down Expand Up @@ -1808,8 +1808,8 @@ foreach (e; randomSample(a, 5, Random(unpredictableSeed))) // correct!
writeln(e);
}
foreach (e; randomSample(a, 5, rndGen)) // WRONG!! rndGen gets copied
{ // by value
foreach (e; randomSample(a, 5, rndGen)) // DANGEROUS!! rndGen gets
{ // copied by value
writeln(e);
}
Expand Down

0 comments on commit 3bdda60

Please sign in to comment.