On Friday, 26 November 2021 at 10:44:10 UTC, Salih Dincer wrote:

* Is the const essential for ranges?
* Is it possible to rewind the pointer (```Node * head;```) when my head is empty by the const?

`empty` is not required to be `const`, but it is required to yield the same result if called multiple times without mutating the range (see https://dlang.org/phobos/std_range_primitives.html#.isInputRange). In other words, you really ought not to mutate the range in implementation of `empty`, or at least not to the extent you seem to want to.

Reply via email to