diff options
author | Ruslan Arutyunyan <ruslan.arutyunyan@intel.com> | 2021-11-26 16:37:31 +0300 |
---|---|---|
committer | Ruslan Arutyunyan <ruslan.arutyunyan@intel.com> | 2021-11-26 17:29:08 +0300 |
commit | f824bb0e36fc7099923f583e4eea4aaa7d296957 (patch) | |
tree | cbc2fd43c5d02a96b1b98349f872093add1b9a8d /pstl | |
parent | 30238c3676d306ad1c6533805ab72c16f4723ab5 (diff) | |
download | llvm-f824bb0e36fc7099923f583e4eea4aaa7d296957.zip llvm-f824bb0e36fc7099923f583e4eea4aaa7d296957.tar.gz llvm-f824bb0e36fc7099923f583e4eea4aaa7d296957.tar.bz2 |
[pstl] Fix incorrect usage of std::invoke_result
std::invoke_result takes function object type and arguments separately
(unlike std::result_of) so, std::invoke_result_t<F()> usage is
incorrect.
On the other hand, we don't need std::invoke() semantics here at all. So
just simplifying the code without extra dependency and use trailing
return type as the fix.
Reviewed By: MikeDvorskiy
Differential Revision: https://reviews.llvm.org/D114624
Diffstat (limited to 'pstl')
-rw-r--r-- | pstl/include/pstl/internal/utils.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pstl/include/pstl/internal/utils.h b/pstl/include/pstl/internal/utils.h index 5de8f75..c181ddb 100644 --- a/pstl/include/pstl/internal/utils.h +++ b/pstl/include/pstl/internal/utils.h @@ -63,15 +63,15 @@ void __invoke_if_not(std::true_type, _Fp) } template <typename _F1, typename _F2> -typename std::invoke_result<_F1()>::type -__invoke_if_else(std::true_type, _F1 __f1, _F2) +auto +__invoke_if_else(std::true_type, _F1 __f1, _F2) -> decltype(__f1()) { return __f1(); } template <typename _F1, typename _F2> -typename std::invoke_result<_F2()>::type -__invoke_if_else(std::false_type, _F1, _F2 __f2) +auto +__invoke_if_else(std::false_type, _F1, _F2 __f2) -> decltype(__f2()) { return __f2(); } |