[patch] Use perfect forwarding in std::function's invokers
Jonathan Wakely
jwakely@redhat.com
Wed Oct 29 18:40:00 GMT 2014
As pointed out in http://stackoverflow.com/q/26543242/981959 our
std::function does more copying/moving than necessary. The solution is
to use perfect forwarding for the internal invoker functions, even if
function<R(Args...)::operator() and the target function take their
arguments by value.
Tested x86_64-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 5170 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20141029/a7408bda/attachment.bin>
More information about the Libstdc++
mailing list