[range] the strange behavior of adjacent_filter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[range] the strange behavior of adjacent_filter

Boost - Dev mailing list
Hi everyone,
Boost.Range has two GitHub issues on the strange behavior of adjacent_find
that have been sitting there for more than two years:

https://github.com/boostorg/range/issues/80
https://github.com/boostorg/range/issues/81

The behavior of the algorithm is not well described, but the intuitive
expectation would be that it returns for every pair of adjacent elements
that match the predicate the second of the pair. However, the unexpected
behavior of the algorithm is that for a non-empty range it literally always
returns the first element.

I do not think that this is by accident, because Ranges V3 also expose the
same behavior:
https://godbolt.org/z/P33j1qvT6

Does anyone happen to know the reasoning or motivation behind this behavior?

Regards,
&rzej;

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost