Re: [committed] libstdc++: Avoid a move in std::function construction (LWG 2447)

2021-08-28 Thread Jonathan Wakely via Gcc-patches
On 27/08/21 00:13 +0100, Jonathan Wakely wrote: This makes the std::function constructor use perfect forwarding, to avoid an unnecessary move-construction of the target. This means we need to rewrite the _Function_base::_Base_manager::_M_init_functor function to use a forwarding reference, and so

[committed] libstdc++: Avoid a move in std::function construction (LWG 2447)

2021-08-26 Thread Jonathan Wakely via Gcc-patches
This makes the std::function constructor use perfect forwarding, to avoid an unnecessary move-construction of the target. This means we need to rewrite the _Function_base::_Base_manager::_M_init_functor function to use a forwarding reference, and so can reuse it for the clone operation. Also simpl