Use INVOKE<R> in std::function, std::bind and std::packaged_task
authorJonathan Wakely <jwakely@redhat.com>
Tue, 14 May 2019 15:25:08 +0000 (16:25 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 14 May 2019 15:25:08 +0000 (16:25 +0100)
commit330b17474c618af0574c0b8e83a06287e53afe87
tree1224a465498d4e2f0f682ff786b28def3273b5c6
parent78c2855df612af45edb78426348296f43f2a8602
Use INVOKE<R> in std::function, std::bind and std::packaged_task

As well as simpifying the code by removing duplication, this means that
we only need to touch std::__invoke_r if we need to implement changes to
INVOKE<R>, such as those in P0932R0.

* include/bits/std_function.h (_Simple_type_wrapper): Remove.
(_Function_handler): Remove partial specializations for void return
types and pointers to member.
(_Function_handler::_M_manager): Adapt to removal of
_Simple_type_wrapper.
(_Function_handler::_M_invoke): Use __invoke_r instead of __invoke.
* include/std/functional (_Bind_result::__enable_if_void)
(_Bind_result::__disable_if_void): Remove sfinae helpers.
(_Bind_result::__call): Use __invoke_r and remove overloads for void
return types.
* include/std/future (__future_base::_Task_state::_M_run)
(__future_base::_Task_state::_M_run_delayed): Use __invoke_r and
change return type of lambda expressions.

From-SVN: r271174
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/std_function.h
libstdc++-v3/include/std/functional
libstdc++-v3/include/std/future