Issue with template function

FG via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 6 09:30:51 PST 2015


On 2015-02-06 at 18:09, Charles wrote:
>          readString(toBytes!char(['t','e','s','t']),0,4).writeln;
>          readString(toBytes!string("test"),0,4).writeln;    // This is line 39

That second line makes no sense (you didn't provide an array of strings).
Why toBytes!string("test") and not toBytes!char("test") or rather:
toBytes!(immutable char)("test") ?


More information about the Digitalmars-d-learn mailing list