aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/set_targ.ads
diff options
context:
space:
mode:
authorTomasz Kamiński <tkaminsk@redhat.com>2025-09-01 14:37:57 +0200
committerTomasz Kamiński <tkaminsk@redhat.com>2025-09-04 15:30:00 +0200
commit1a41e52d7ecb583947a37b8d2e16a0a9ea3777a4 (patch)
tree99be92513f7704932ae913b2d2df3e9e44c45c44 /gcc/ada/set_targ.ads
parentb2adb7712cc57920d7d791c185dbf88e83b885c2 (diff)
downloadgcc-master.zip
gcc-master.tar.gz
gcc-master.tar.bz2
libstdc++: Reuse _Bind_back_t functor in ranges::_PartialHEADtrunkmaster
This patch refactors ranges::_Partial to be implemented using _Bind_back_t. This allows it to benefit from the changes in r16-3398-g250dd5b5604fbc, specifically making the closure trivially copyable. Since _Bind_back_t already provides an optimized implementation for a single bound argument, specializations for _Partial with a single argument are now removed. We still preserve a specialization of _Partial for trivially copy-constructible arguments that define only a const overload of operator(). To avoid re-checking invocability constraints, this specialization calls the now-public, unconstrained _Binder::_S_call static method instead of the constrained _Binder::operator(). The primary specialization of _Partial retains its operator(), which uses a simpler __adaptor_invocable constraint that does not consider member pointers, as they are not relevant here. This implementation also calls _Binder::_S_call to avoid re-performing overload resolution and invocability checks for _Binder::operator(). Finally, the _M_binder member (_Bind_back_t) is now marked [[no_unique_address]]. This is beneficial as ranges::_Partial is used with ranges::to, which commonly has zero or empty bound arguments (e.g., stateless allocators, comparators, or hash functions). libstdc++-v3/ChangeLog: * include/bits/binders.h (_Binder::_S_call): Make public. * include/std/ranges (ranges::_Partial<_Adaptor, _Args...>): Replace tuple<_Args...> with _Bind_back_t<_Adaptor, _Args...>. (ranges::_Partial<_Adaptor, _Arg>): Remove. Reviewed-by: Patrick Palka <ppalka@redhat.com> Reviewed-by: Jonathan Wakely <jwakely@redhat.com> Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
Diffstat (limited to 'gcc/ada/set_targ.ads')
0 files changed, 0 insertions, 0 deletions