Skip to content
Snippets Groups Projects
Commit d2cb4693 authored by Patrick Palka's avatar Patrick Palka
Browse files

libstdc++/ranges: Use C++23 deducing this in _Pipe and _Partial

This simplifies the operator() of the _Pipe and _Partial range adaptor
closure objects using C++23 deducing this, allowing us to condense
multiple operator() overloads into one.

The new __like_t alias template is similar to the expositional one from
P0847R6 except it's implemented in terms of forward_like instead of vice
versa, and thus ours always yields a reference so e.g. __like_t<A, char>
is char&& instead of char.  For our purposes (forwarding) this shouldn't
make a difference, I think..

libstdc++-v3/ChangeLog:

	* include/bits/move.h (__like_t): Define in C++23 mode.
	* include/std/ranges (views::__adaptor::Partial::operator()):
	Implement using C++23 deducing this when available.
	(views::__adaptor::_Pipe::operator()): Likewise.
	* testsuite/std/ranges/adaptors/100577.cc: Adjust testcase to
	accept new "no match for call" errors issued in C++23 mode.
	* testsuite/std/ranges/adaptors/lazy_split_neg.cc: Likewise.
parent a2be4e15
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment