diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-11-14 16:57:17 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2024-11-14 20:01:25 +0000 |
commit | 45cc42d6dc0642612e7076e95820438a1aab5479 (patch) | |
tree | 3b0dbe694c500a81a359cbda541e3a9d602828a5 /gcc/fortran/trans-expr.cc | |
parent | 012f5a22bac26a898ab66655965b07ac23201fdd (diff) | |
download | gcc-45cc42d6dc0642612e7076e95820438a1aab5479.zip gcc-45cc42d6dc0642612e7076e95820438a1aab5479.tar.gz gcc-45cc42d6dc0642612e7076e95820438a1aab5479.tar.bz2 |
libstdc++: Make equal and is_permutation short-circuit (LWG 3560)
We already implement short-circuiting for random access iterators, but
we also need to do so for ranges::equal and ranges::is_permutation when
given sized ranges that are not random access ranges (e.g. std::list).
libstdc++-v3/ChangeLog:
* include/bits/ranges_algo.h (__is_permutation_fn::operator()):
Short-circuit for sized ranges with different sizes, as per LWG
3560.
* include/bits/ranges_algobase.h (__equal_fn::operator()):
Likewise.
* include/bits/stl_algo.h (__is_permutation): Use if-constexpr
for random access iterator branches.
* include/bits/stl_algobase.h (__equal4): Likewise.
* testsuite/25_algorithms/equal/lwg3560.cc: New test.
* testsuite/25_algorithms/is_permutation/lwg3560.cc: New test.
Reviewed-by: Patrick Palka <ppalka@redhat.com>
Diffstat (limited to 'gcc/fortran/trans-expr.cc')
0 files changed, 0 insertions, 0 deletions