|
Boost : |
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2021-03-31 22:33:19
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;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk