On Sunday, 15 May 2016 at 09:20:22 UTC, Joseph Rushton Wakeling
The generators are all implemented as structs, but in order to
prevent some known problems with unintended copy-by-value of
RNGs, the postblit has been disabled. For similar reasons,
these generators are implemented as input ranges, not forward
ranges, so that library functionality cannot copy generator
state under the hood.
`dup` properties are however provided for all generators, to
allow the programmer to deliberately copy RNG state.
Testing, feedback and general usage are all welcome. I am
planning on submitting these to Phobos (although sorting out
the generic side of things might be a good idea first).
The "@disable this" is really a concern, because pointers have to
be used (for example if the seed comes from a program option and
that the gen is a global var then global var must be a pointer to
I see that you are yourself affected by the issue because in the
unittest you must take the gen address to use it in take .
The main consequence is that they are unsable in @safe code !