[PATCH] P0356R5 Simplified partial function application

Jonathan Wakely jwakely@redhat.com
Thu Mar 7 14:41:00 GMT 2019


On 07/03/19 14:15 +0000, Jonathan Wakely wrote:
>	* include/std/functional [C++20] (_Bind_front, _Bind_front_t): Define
>	helpers for bind_front.
>	(bind_front, __cpp_lib_bind_front): Define.
>	* testsuite/20_util/function_objects/bind_front/1.cc: New test.

I'm considering something like the attached patch (but with better
names for __tag1 and __tag2 obviously). With this change bind_front
would unwrap nested binders, so that bind_front(bind_front(f, 1), 2)
would create a _Bind_front<F, int, int> instead of
_Bind_front<_Bind_front<F, int>, int>.

That would make the call go straight to the target object, instead of
through an extra layer of wrapper (which should improve compile times,
and also unoptimized runtime performance).



-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 3399 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190307/78d152cc/attachment.bin>


More information about the Gcc-patches mailing list