Replace following names:
std.typetuple -> std.meta
TypeTuple -> AliasSeq
ParameterTypeTuple -> Parameters
FieldTypeTuple -> Fields
std.traits requires more work than search/replace and is left unchanged.
The existing docs have not been tweaked in any way, so the new additions
result in some duplication of information. This seems a better first
step than a more major revision.
Documentation for struct methods has been left unchanged, and will be
addressed in a later patch.
I've also left the documentation for uniformDistribution unchanged as
IMHO this function is so broken in its design, it really ought to be
deprecated and removed :-)
Added a cast to ensure the setting of lower bound can handle character
types and integral types smaller than int. The additional unittests
should prevent such issues from arising again.
Since [dchar.min, dchar.max] does not cover the full bit range of dchar,
optimizations that work for other integral types will fail here, and
result in illegal unicode points being generated.
This fix avoids breaking any existing calls to uniform() via a twofold
approach:
* uniform!"[]"(T.min, T.max) will only call uniform!ResultType if
T is not a dchar;
* uniform!dchar will not try and use the entire bit range but will
instead call uniform!"[]"(dchar.min, dchar.max).
Unittests have been added that should prevent such issues from arising
again.
Following typical design in other languages, the function is named
uniform01. It can be templated on floating-point type, defaulting
to double if none is specified.
The implementation is pretty much derived from its counterpart in
Boost.Random, in particular in its taking account of the different
requirements for integral versus floating-point RNG values, and in
checking that the generated variate is less than 1 before returning.
This last check is necessary simply because we can't guarantee, in
the case of a floating-point based RNG, that we will not get a
result exactly equal to 1.
Fixes http://d.puremagic.com/issues/show_bug.cgi?id=5240