Oversight in initial implementation in #4384. Noticed while benchmarking #4659
Might be superseded by #4453.
The optimization is performed in _Minmax_fwd_unchecked. We don't pick this branch for smaller elements, because _Prefer_iterator_copies evaluates to false.
|
if constexpr (forward_range<_Rng> && _Prefer_iterator_copies<iterator_t<_Rng>>) {
|
|
return _Minmax_fwd_unchecked(
|
|
_STD move(_UFirst), _STD move(_ULast), _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj));
|
|
} else {
|
Oversight in initial implementation in #4384. Noticed while benchmarking #4659
Might be superseded by #4453.
The optimization is performed in
_Minmax_fwd_unchecked. We don't pick this branch for smaller elements, because_Prefer_iterator_copiesevaluates tofalse.STL/stl/inc/algorithm
Lines 10417 to 10420 in 8dc4faa