where constantIter and mutableIter is otherwise compatible iterators into const and non-const views of the same range, respectively.
This can be reproduced with any other custom view adaptor, where the adaptor allows for conversion, and provide correct assignment semantics, but fail to provide symmetric comparison. E.g.: https://godbolt.org/z/19qGGM
For context, I ran into this issue while upgrading our in-house Boost.Range (v2) iterators and ranges to range-v3. This was a showstopper. Here is the same example as above with Boost.Range fwiw: https://godbolt.org/z/MKKvWY
Here is the issue in detail: https://godbolt.org/z/Ehsc36
In summary:
where
constantIter
andmutableIter
is otherwise compatible iterators intoconst
andnon-const
views of the same range, respectively.This can be reproduced with any other custom view adaptor, where the adaptor allows for conversion, and provide correct assignment semantics, but fail to provide symmetric comparison. E.g.: https://godbolt.org/z/19qGGM
For context, I ran into this issue while upgrading our in-house Boost.Range (v2) iterators and ranges to range-v3. This was a showstopper. Here is the same example as above with Boost.Range fwiw: https://godbolt.org/z/MKKvWY
Is there a workaround?