input range from stdin

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 17 07:37:20 PDT 2014


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));


More information about the Digitalmars-d-learn mailing list