Tomasz Kamiński 1a41e52d7e libstdc++: Reuse _Bind_back_t functor in ranges::_Partial
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>
2025-09-04 15:30:00 +02:00
2025-08-11 00:16:52 +00:00
2025-08-18 00:18:52 +00:00
2025-08-29 00:19:55 +00:00
2025-09-04 15:23:07 +02:00
2025-08-17 00:19:17 +00:00
2025-09-02 00:19:26 +00:00
2025-08-31 00:18:58 +00:00
2025-08-21 00:20:43 +00:00
2025-09-03 00:20:18 +00:00
2025-08-07 00:20:46 +00:00
2025-08-17 00:19:17 +00:00
2025-09-03 00:20:18 +00:00
2025-09-02 00:19:26 +00:00
2025-09-04 00:20:48 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.7%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.4%