On Thursday, 11 December 2014 at 20:37:09 UTC, Kapps wrote:
Ranges are one way of allowing foreach. The other is through
the use of opApply, which is what std.stdio.lines does.
http://dlang.org/statement.html#ForeachStatement
Ah, so I just needed to keep reading down a few lines in the
forea
On 12/11/14 3:21 PM, Andrew Klaassen wrote:
On Thursday, 11 December 2014 at 20:17:50 UTC, bearophile wrote:
Andrew Klaassen:
The docs for stdio.lines say that it's a struct. stdio.lines works
with foreach.
If you want a range use "myfile".File.byLine or "myfile".File.byLineCopy.
Bye,
bear
On Thursday, 11 December 2014 at 20:11:21 UTC, Andrew Klaassen
wrote:
The docs for stdio.lines say that it's a struct. stdio.lines
works with foreach.
The docs for foreach say:
"Iteration over struct and class objects can be done with
ranges. For foreach, this means the following properties
On Thursday, 11 December 2014 at 20:17:50 UTC, bearophile wrote:
Andrew Klaassen:
The docs for stdio.lines say that it's a struct. stdio.lines
works with foreach.
If you want a range use "myfile".File.byLine or
"myfile".File.byLineCopy.
Bye,
bearophile
I know that there are other ways t
Andrew Klaassen:
The docs for stdio.lines say that it's a struct. stdio.lines
works with foreach.
If you want a range use "myfile".File.byLine or
"myfile".File.byLineCopy.
Bye,
bearophile
The docs for stdio.lines say that it's a struct. stdio.lines
works with foreach.
The docs for foreach say:
"Iteration over struct and class objects can be done with ranges.
For foreach, this means the following properties and methods must
be defined: .empty ... .front ... .popFront()"
But