Magnus Lie Hetland:

The following fails, which I guess is a bug?

import std.algorithm;
void main() {
        char[] a = ['a', 'b', 'c'];
        sort(a);
}

It's not a bug, char is meant to be a UTF-8. Two workarounds:

import std.algorithm;
void main() {
        dchar[] a1 = ['a', 'b', 'c'];
        sort(a1);
        char[] a2 = ['a', 'b', 'c'];
        sort(cast(ubyte[])a2);
}

Bye,
bearophile

Reply via email to