Patrick Palka b8314ebff2 libstdc++: Avoid unnecessary copies in ranges::min/max [PR112349]
Use a local reference for the (now possibly lifetime extended) result of
*__first so that we copy it only when necessary.

	PR libstdc++/112349

libstdc++-v3/ChangeLog:

	* include/bits/ranges_algo.h (__min_fn::operator()): Turn local
	object __tmp into a reference.
	* include/bits/ranges_util.h (__max_fn::operator()): Likewise.
	* testsuite/25_algorithms/max/constrained.cc (test04): New test.
	* testsuite/25_algorithms/min/constrained.cc (test04): New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-12-13 13:17:29 -05:00
2024-05-09 10:58:01 +00:00
2024-11-26 00:19:26 +00:00
2024-12-11 00:19:28 +00:00
2024-07-12 00:17:52 +00:00
2024-07-08 00:17:01 +00:00
2024-04-16 00:18:06 +00:00
2024-11-24 00:18:09 +00:00
2024-01-03 12:19:35 +01:00
2024-11-19 00:19:52 +00:00
2024-11-30 00:20:11 +00:00
2024-09-21 00:16:55 +00:00
2024-12-09 00:17:22 +00:00
2024-04-03 00:17:29 +00:00
2024-10-26 00:19:39 +00:00
2024-12-13 00:19:02 +00:00
2024-12-11 00:19:28 +00:00
2024-11-21 00:20:27 +00:00
2024-12-11 00:19:28 +00:00
2024-12-10 00:19:34 +00:00
2024-12-12 00:19:00 +00:00
2024-11-19 00:19:52 +00:00
2024-09-24 00:18:14 +00:00
2024-11-19 00:19:52 +00:00
2024-08-29 00:19:25 +00:00
2024-11-26 00:19:26 +00:00
2024-05-09 10:58:01 +00:00
2024-11-19 00:19:52 +00:00
2024-08-24 00:18:13 +00:00
2024-12-04 00:21:20 +00:00
2024-09-12 22:51:00 +08:00
2024-12-12 00:19:00 +00:00
2024-11-19 12:27:33 +01: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 1.5 GiB
Languages
C++ 30.7%
C 30%
Ada 14.5%
D 6.1%
Go 5.7%
Other 12.5%