summaryrefslogtreecommitdiff
path: root/pstl
diff options
context:
space:
mode:
authorRuslan Arutyunyan <ruslan.arutyunyan@intel.com>2021-11-26 16:37:31 +0300
committerRuslan Arutyunyan <ruslan.arutyunyan@intel.com>2021-11-26 17:29:08 +0300
commitf824bb0e36fc7099923f583e4eea4aaa7d296957 (patch)
treecbc2fd43c5d02a96b1b98349f872093add1b9a8d /pstl
parent30238c3676d306ad1c6533805ab72c16f4723ab5 (diff)
downloadllvm-f824bb0e36fc7099923f583e4eea4aaa7d296957.tar.gz
[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.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/pstl/include/pstl/internal/utils.h b/pstl/include/pstl/internal/utils.h
index 5de8f7581424..c181ddb4b8a6 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();
}