diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-04-25 14:22:41 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-04-25 16:16:33 +0100 |
commit | a5cee0480c10bafa8ed65d49e5cedca23d98d7b7 (patch) | |
tree | 85183cccab9b63b13a1458d93ae1b2965ae73ea4 /libstdc++-v3/include | |
parent | 1ba397e9f93d3abc93a6ecbabc3d873489a6fb7f (diff) | |
download | gcc-a5cee0480c10bafa8ed65d49e5cedca23d98d7b7.tar.gz |
libstdc++: Add deduction guides for std::packaged_task [PR105375]
This change was LWG 3117.
The test is copied from 20_util/function/cons/deduction.cc
libstdc++-v3/ChangeLog:
PR libstdc++/105375
* include/std/future (packaged_task): Add deduction guides.
* testsuite/30_threads/packaged_task/cons/deduction.cc: New test.
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/std/future | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index cba40dc0883..a9268cade91 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -1622,6 +1622,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } }; + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 3117. Missing packaged_task deduction guides +#if __cpp_deduction_guides >= 201606 + template<typename _Res, typename... _ArgTypes> + packaged_task(_Res(*)(_ArgTypes...)) -> packaged_task<_Res(_ArgTypes...)>; + + template<typename _Fun, typename _Signature = typename + __function_guide_helper<decltype(&_Fun::operator())>::type> + packaged_task(_Fun) -> packaged_task<_Signature>; +#endif + /// swap template<typename _Res, typename... _ArgTypes> inline void |