https://issues.dlang.org/show_bug.cgi?id=12877
Issue ID: 12877
Summary: std.random.uniform cannot handle dchar variates
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: Phobos
Assignee: [email protected]
Reporter: [email protected]
The uniform!T specialization, which returns a random variate covering the
entire bit range of an integral or character type T, will fail in the event
that T == dchar because dchar.max is significantly less than the largest number
that can be stored in dchar's 32 bits.
This in turn leads uniform!"[]"(dchar.min, dchar.max) to fail, because the
integral/character-type uniform() calls uniform!ReturnType in the event of a
closed interval with bounds [ReturnType.min, ReturnType.max].
See forum discussion for further details, including code that illustrates the
bug:
http://forum.dlang.org/thread/[email protected]
--