On Mon, Nov 18, 2019 at 7:25 PM Steven Schveighoffer via
Digitalmars-d-learn wrote:
>
>
> You could also use cast(dchar[]), and avoid the cast back to char.
>
> -Steve
or use byCodeUnit
writeln(['a', 'b', 'c'].byCodeUnit.choice);
On 11/18/19 12:32 PM, mipri wrote:
Howdy,
The following program fails to compile if the second line
is uncommented:
import std;
void main() {
writeln([1, 2, 3].choice);
//writeln(['a', 'b', 'c'].choice);
}
Error: template std.random.choice cannot deduce function from argument
Howdy,
The following program fails to compile if the second line
is uncommented:
import std;
void main() {
writeln([1, 2, 3].choice);
//writeln(['a', 'b', 'c'].choice);
}
Error: template std.random.choice cannot deduce function from
argument types !()(char[],