The current implementation of ranged in std-indices exposes an iterator class as random access iterator using the corresponding iterator tag, but does not define all the operators that would be needed for a random access iterator. In particular, operators to decrement (or subtract) are missing.
The issue can be fixed either by implementing the missing operators, or exposing the iterator as something that matches better the implemented functionality, such as a forward iterator.
It's not clear to me which approach is the right one - this PR changes the tag to a forward iterator, since this seemed like the easiest way to fix the issue, and is a one-line change.
The current implementation of
ranged
instd-indices
exposes an iterator class as random access iterator using the corresponding iterator tag, but does not define all the operators that would be needed for a random access iterator. In particular, operators to decrement (or subtract) are missing.This causes important iterator-related STL functions to fail, such as
std::advance()
. https://godbolt.org/z/Go5ojEP7fThe issue can be fixed either by implementing the missing operators, or exposing the iterator as something that matches better the implemented functionality, such as a forward iterator.
It's not clear to me which approach is the right one - this PR changes the tag to a forward iterator, since this seemed like the easiest way to fix the issue, and is a one-line change.