std.utf.decode("dlang", 1)

Algo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 17 23:23:54 PDT 2014


On Thursday, 18 September 2014 at 06:09:54 UTC, Algo wrote:
> void main()
> {
>       import std.utf;
>       decode("dlang", 1);
> }
>
> Error: template std.utf.decode cannot deduce function from
> argument types !()(string, int), candidates are:
> D:\msc\D\dmd2\windows\bin\..\..\src\phobos\std\utf.d(924):
> std.utf.decode(S)(auto ref S str, ref size_t index) if
> (!isSomeString!S && isRandomAccessRange!S && hasSlicing!S &&
> hasLength!S && isSomeChar!(ElementType!S))
> D:\msc\D\dmd2\windows\bin\..\..\src\phobos\std\utf.d(942):
> std.utf.decode(S)(auto ref S str, ref size_t index) if
> (isSomeString!S)
>
> why doesn't "decode(S)(auto ref S str, ref size_t index) if
> (isSomeString!S)" correspond?

rvalues cannot be ref it seems


More information about the Digitalmars-d-learn mailing list