--- Comment #5 from Jonathan M Davis <jmdavisp...@gmx.com> 2012-06-15 01:05:40
> Why should a RNG type have reference semantics? I think it's fine to pass them
by reference where needed.
Because it makes no sense for it to have value semantics. Take this for example
auto func(R)(R r)
auto var1 = r.front;
auto var2 = generator.front;
Both var1 and var2 will have the exact same value. This is an easy mistake to
make, and since random number generators are supposed to be returning random
numbers, having them return the _same_ number after popFront has been called is
By making them reference types, the only time that you get the same number
multiple times in a row is when you do it on purpose (e.g. by storing the value
of front or by calling save on the range).
There's a discussion on this in issue# 7067.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------