On 14/02/2018 5:13 PM, Jonathan M Davis wrote:
On Wednesday, February 14, 2018 14:09:21 rikki cattermole via Digitalmars-d-
announce wrote:
On 14/02/2018 2:02 PM, Adrian Matoga wrote:
On Wednesday, 14 February 2018 at 10:57:26 UTC, rikki cattermole wrote:
See lines:
- Input!IR temp = input;
- input = temp;

            bool commentLine() {
         Input!IR temp = input;

(...)
         if (!temp.empty) {
(...)
             input = temp;
             return true;
         } else
             return false;
     }

`temp = input.save` is exactly what you want here, which means forward
range is required. Your example won't work for range objects with
reference semantics.

Ah I must be thinking of ranges that support indexing.

Random access ranges are also forward ranges and would require a call to
save here.

- Jonathan M Davis


Luckily in my code I can forget that ;)

Reply via email to