On Thu, 21 Jan 2016 14:07:16 +0000, W.J. wrote: > So writeln consumes the values in an InputRange. That leads me to > believe that if I feed an InputRange to foreach, it will consume the > values, too. > Did I get that right ?
In general, yes. Some ranges have value semantics and can be saved simply by assigning them to a new variable, or passing them to a function.