libstdc++: Use C++23 deducing this in std::bind_front
commit3e1ffa7dd111374a5e277b71269f9b6e10b3ec57
authorPatrick Palka <ppalka@redhat.com>
Sat, 13 Jan 2024 03:55:43 +0000 (12 22:55 -0500)
committerPatrick Palka <ppalka@redhat.com>
Sat, 13 Jan 2024 03:55:43 +0000 (12 22:55 -0500)
tree4a12b85c2ce18c05ecbc17bffa72b52c2a05bbd5
parentc48bedd180672276cc58f379a6346309366b7ea7
libstdc++: Use C++23 deducing this in std::bind_front

This simplifies the operator() of _Bind_front using C++23 deducing
this, allowing us to condense multiple operator() overloads into one.

In passing I think we can remove _Bind_front's defaulted special member
declarations and just let the compiler implicitly generate them for us.

libstdc++-v3/ChangeLog:

* include/std/functional (_Bind_front): Remove =default special
member function declarations.
(_Bind_front::operator()): Implement using C++23 deducing this
when available.
* testsuite/20_util/function_objects/bind_front/111327.cc:
Adjust testcase to expect better errors in C++23 mode.
libstdc++-v3/include/std/functional
libstdc++-v3/testsuite/20_util/function_objects/bind_front/111327.cc