[libcxx-commits] [pstl] d01d91d - [libc++][pstl][NFC] Remove usage of std::result_of from Parallel STL
Ruslan Arutyunyan via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 31 11:27:06 PST 2022
Author: Ruslan Arutyunyan
Date: 2022-01-31T22:24:51+03:00
New Revision: d01d91d1aec9cca8dc7259009a6b3db0900e8623
URL: https://github.com/llvm/llvm-project/commit/d01d91d1aec9cca8dc7259009a6b3db0900e8623
DIFF: https://github.com/llvm/llvm-project/commit/d01d91d1aec9cca8dc7259009a6b3db0900e8623.diff
LOG: [libc++][pstl][NFC] Remove usage of std::result_of from Parallel STL
std::result_of creates problems when building with C++20 because it's
deprecated there.
The solution is to remove it and get return value type for a function
with decltype.
Substitute std::invoke_result for std::result_of is unnecessary because
we don't have std::invoke semantics within the function - we don't work
with pointer-to-member's.
Reviewed by: ldionne, MikeDvorskiy, #libc
Differential Revision: https://reviews.llvm.org/D118457
Added:
Modified:
pstl/include/pstl/internal/utils.h
Removed:
################################################################################
diff --git a/pstl/include/pstl/internal/utils.h b/pstl/include/pstl/internal/utils.h
index c181ddb4b8a65..ec9d46713a682 100644
--- a/pstl/include/pstl/internal/utils.h
+++ b/pstl/include/pstl/internal/utils.h
@@ -21,8 +21,8 @@ namespace __internal
{
template <typename _Fp>
-typename std::result_of<_Fp()>::type
-__except_handler(_Fp __f)
+auto
+__except_handler(_Fp __f) -> decltype(__f())
{
try
{
More information about the libcxx-commits
mailing list