input range from stdin
krzaq via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Sep 17 08:30:29 PDT 2014
On Wednesday, 17 September 2014 at 14:37:21 UTC, Marc Schütz
wrote:
> On Wednesday, 17 September 2014 at 12:44:00 UTC, krzaq wrote:
>> I'd like to have something similar to C++'s
>> std::istream_iterator<int>(std::cin)
>>
>> Is it possible? I'm relatively indifferent to efficiency of
>> the solution.
>
> import std.stdio;
> import std.algorithm;
> import std.conv;
> writeln(stdin.byLine.map!(to!int));
What happens if I later have some strings that I want to read
from the same line?
How can I use the resultant range with std.fill?
My idea doesn't seem to work: http://dpaste.dzfl.pl/130e14c927f3
More information about the Digitalmars-d-learn
mailing list