This project is read-only.
1

Resolved

Fix front and back access to more than bidirectional ranges

description

The semantics for accessing the front and back elements of ranges of category greater or equal than bidirectional needs to be defined.

Proposal

After a successful call of either move_front or move_back both accessors, front and back can be invoked and deliver a defined value.

Rationale

This is simply expected behavior. I can't imagine a simpler and more concise definition. I'd preferred a definition which allows to implement side-effect free constructors but I couldn't come up with nearly that simple and concise specification for that.

Implementation

Almost all adapters use specific initialization code in constructors which assures the correctness of the above specification. This means that some complex adapters will possess constructors which impose some side effects on wrapped ranges - for example a filter will need to adjust the underlying range such that the above definition is satisfied.

comments

michalik wrote Oct 8, 2013 at 7:18 AM

Pending. Currently, adapter ranges such as filter_adapter ensure that correct interval is calculated during construction. I'm not really happy about that, since it somewhat contradicts the laziness principle...