eliminate cast

Dee Girl deegirl at noreply.com
Wed May 14 07:42:13 PDT 2008


There is a file data.txt with numbers:

345
5467
45
238
...

And I want to load into an array of uint like this.

auto sizes = map!
    (to!(uint, string))
    (compose!(split, q{cast(string) std.file.read(a)})("data.txt"));

It works but cast is always bad ^_^. How can I eliminate cast? Is there function to read entire text file in string? Thank you, Dee Girl



More information about the Digitalmars-d mailing list