decodeGrapheme & static array

Robert M. Münch robert.muench at saphirion.com
Sat Jan 4 19:56:54 UTC 2020


I have:

Grapheme[] gr;
dchar[1] buf;
encode(buf, cast(dchar)myData);
gr =~ decodeGrapheme(buf[]);

Which gives:

Error: template std.uni.decodeGrapheme cannot deduce function from 
argument types !()(dchar[]), candidates are:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\uni.d(7164,10):        
decodeGrapheme(Input)(ref Input inp)

I some how need an InputRange for buf and though that buf[] should 
work. But it doesn't seem to be an L-value... which I don't understand. 
I thought buf[] returns a temporary dynamic array initialized with the 
buf content.

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list