libostd
ostd::forward_range_tag Struct Reference

The forward range tag. More...

Inheritance diagram for ostd::forward_range_tag:
ostd::input_range_tag ostd::bidirectional_range_tag ostd::random_access_range_tag ostd::finite_random_access_range_tag ostd::contiguous_range_tag

Detailed Description

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.

See also
ostd::input_range_tag, ostd::bidirectional_range_tag

The documentation for this struct was generated from the following file: