diff options
author | Patrick Palka <ppalka@redhat.com> | 2025-07-06 14:49:34 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2025-07-06 14:49:34 -0400 |
commit | 2a56f3c539b782b15ee76d5752921800ccc53eef (patch) | |
tree | 2857414c7e542d80baa97123e3df3ae79ca9a1a0 /libgo/go/encoding | |
parent | bac45dda59cbd8419bd4513b1a76365825ac8307 (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
The implementation is just a copy of std::shift_left/right with the
following changes:
- check bidirectional_iterator instead of iterator_category
- cope with __last being a distinct sentinel type
- for shift_left, return the subrange {__first, X} instead of X
- for shift_right, return the subrange {X, ranges::next(__first, __last)}
instead of X
- use the ranges:: versions of move_backward, move and iter_swap
- don't bother std::move'ing any iterators, it's unnecessary since all
iterators are forward, it's visually noisy, and in earlier versions
of this patch it introduced subtle use-after-move bugs
In passing also use the __glibcxx_shift macro to guard the
std::shift_left/right implementations.
libstdc++-v3/ChangeLog:
* include/bits/ranges_algo.h (shift_left, shift_right): Guard
with __glibcxx_shift >= 201806L.
(ranges::__shift_left_fn, ranges::shift_left): Define for C++23.
(ranges::__shift_right_fn, ranges::shift_right): Likewise.
* include/bits/version.def (shift): Update for C++23.
* include/bits/version.h: Regenerate.
* src/c++23/std.cc.in: Add ranges::shift_left/right.
* testsuite/25_algorithms/shift_left/constrained.cc: New test,
based off of 1.cc.
* testsuite/25_algorithms/shift_right/constrained.cc: New test,
based off of 1.cc.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Diffstat (limited to 'libgo/go/encoding')
0 files changed, 0 insertions, 0 deletions