Hi

I'm trying to shuffle a character array but I get some compilation errors.

*
char[] upper = std.ascii.uppercase.dup;
randomShuffle!(typeof(upper))(upper);

randomShuffle(upper);

example.d(34): Error: template std.random.randomShuffle cannot deduce function from argument types !(char[])(char[]), candidates are: /usr/include/dmd/phobos/std/random.d(1822): std.random.randomShuffle(Range, RandomGen)(Range r, ref RandomGen gen) if (isRandomAccessRange!Range && isUniformRNG!RandomGen) /usr/include/dmd/phobos/std/random.d(1829): std.random.randomShuffle(Range)(Range r) if (isRandomAccessRange!Range)

example.d(34): Error: template std.random.randomShuffle cannot deduce function from argument types !()(char[]), candidates are: /usr/include/dmd/phobos/std/random.d(1822): std.random.randomShuffle(Range, RandomGen)(Range r, ref RandomGen gen) if (isRandomAccessRange!Range && isUniformRNG!RandomGen) /usr/include/dmd/phobos/std/random.d(1829): std.random.randomShuffle(Range)(Range r) if (isRandomAccessRange!Range)
*

I thought that I could use a dynamic array as a range ...

Reply via email to