libstdc++: Reduce size of std::bind_front(F) result
authorJonathan Wakely <jwakely@redhat.com>
Mon, 21 Nov 2022 11:30:55 +0000 (11:30 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 21 Nov 2022 17:46:42 +0000 (17:46 +0000)
commitcbd05ca5ab1231d70d07e1ffbe64c1b7338bf1d6
tree3b0aa0a1c9458a0f535f189fd982e8cc854243fa
parented77dcb9be76e592b62449c75a5e751485514afd
libstdc++: Reduce size of std::bind_front(F) result

When there are no bound arguments to a std::bind_front call we don't
need the overhead of compiling, initializing, and accessing an empty
tuple.

libstdc++-v3/ChangeLog:

* include/std/functional (_Bind_front0): New class template.
(_Bind_front_t): Use _Bind_front0 when there are no bound
arguments.
* testsuite/20_util/function_objects/bind_front/107784.cc:
New test.
libstdc++-v3/include/std/functional
libstdc++-v3/testsuite/20_util/function_objects/bind_front/107784.cc [new file with mode: 0644]