libostd
|
The forward range tag. More...
The forward range tag.
This one is just like ostd::input_range_tag, it doesn't even add anything to the interface, but it has an extra guarantee - you can copy forward ranges and the copies won't affect each other's state. For example, with I/O streams the ranges point to a stream with some shared state, so the current position/element is defined by the stream itself, but with most other objects you can represent the current position/element within the range itself; for example a singly-linked list range can be forward, because you can have one range pointing to one node, then copy it, pop out the front element in the new copy and still have the previous range point to the old element.
Any forward range is at the same time input. That's why this tag derives from it.
You can learn more about the characteristics here.