Why toUTF8 not accept wchar[] as argument?

Domain dont_email at empty.com
Tue Apr 3 02:24:08 UTC 2018


wchar[10] buffer;
toUTF8(buffer);

Error: template `std.utf.toUTF8` cannot deduce function from 
argument types `!()(wchar[10])`, candidates are:
/dlang/dmd/linux/bin64/../../src/phobos/std/utf.d(2713):        
`std.utf.toUTF8(S)(S s) if (isInputRange!S && !isInfinite!S && 
isSomeChar!(ElementEncodingType!S))`


I know buffer.idup is OK. But why? That's very inconvenient.


More information about the Digitalmars-d-learn mailing list