[libcxx-commits] [PATCH] D118457: [libc++][pstl][NFC] Remove usage of std::result_of from Parallel STL

Ruslan Arutyunyan via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 28 05:02:55 PST 2022


rarutyun created this revision.
rarutyun added reviewers: ldionne, Quuxplusone, MikeDvorskiy.
rarutyun added a project: libc++.
rarutyun requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

`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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118457

Files:
  pstl/include/pstl/internal/utils.h


Index: pstl/include/pstl/internal/utils.h
===================================================================
--- pstl/include/pstl/internal/utils.h
+++ pstl/include/pstl/internal/utils.h
@@ -21,8 +21,8 @@
 {
 
 template <typename _Fp>
-typename std::result_of<_Fp()>::type
-__except_handler(_Fp __f)
+auto
+__except_handler(_Fp __f) -> decltype(__f())
 {
     try
     {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118457.403969.patch
Type: text/x-patch
Size: 372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220128/1d29caca/attachment.bin>


More information about the libcxx-commits mailing list