Casting between char[]/wchar[]/dchar[]

Derek Parnell derek at psyc.ward
Sat Aug 5 15:35:51 PDT 2006


On Sat, 5 Aug 2006 17:23:08 -0400, Jarrett Billingsley wrote:

> import utf = std.utf;
> 
> wchar[] utf16(char[] s)
> {
>     return utf.toUTF16(s);
> }
> 
> ...
> 
> char[] s = "hello";
> wchar[] t = s.utf16;
> 
>  ;)
> 
> Aren't first-array-param-as-a-property functions cool?

Actually, that doesn't compile any more either.

Instead of 

   wchar[] t = s.utf16;

you have to code ...

   wchar[] t = s.utf16();

I'm sure it used to work the way you wrote it.

-- 
Derek Parnell
Melbourne, Australia
"Down with mediocrity!"



More information about the Digitalmars-d mailing list