import std.random, std.stdio;
void main() {
foreach(i; 0..1_000) {
write(uniform!"[]"('A', 'Z'));
}
}
Prints: All A's. If 'A' and 'Z' are cast to ubyte, the results look reasonable.
Comment #1 by dsimcha — 2009-05-03T14:41:51Z
Created attachment 346
Make uniform work with chars.
It's just a problem of uniform trying to treat characters as if they were floating point types because isIntegral!(char) is false. Here's a patch that just makes a new template isIntOrChar(T) and uses that instead.