The Case For Autodecode

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 3 12:12:33 PDT 2016


On 6/3/16 3:09 PM, Steven Schveighoffer wrote:
>
> Hm... an interesting possiblity:
>
> dchar _dchar_convert(char c)
> {
>    return cast(int)cast(byte)c; // get sign extension for non-ASCII
> }

Allows this too:

dchar d = char.init; // calls conversion function
assert(d == dchar.init);

:)

-Steve


More information about the Digitalmars-d mailing list