[libcxx-commits] [libcxx] 09a84d3 - [libc++] Match declaration for non-member function std::swap(std::packaged_task) with what standard specify

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 24 15:34:15 PDT 2021


Author: jasonliu
Date: 2021-03-24T22:33:32Z
New Revision: 09a84d304776cbd97a31fbb0cc8ce772426aaabf

URL: https://github.com/llvm/llvm-project/commit/09a84d304776cbd97a31fbb0cc8ce772426aaabf
DIFF: https://github.com/llvm/llvm-project/commit/09a84d304776cbd97a31fbb0cc8ce772426aaabf.diff

LOG: [libc++] Match declaration for non-member function std::swap(std::packaged_task) with what standard specify

Standard specifies:
```
template<class R, class... ArgTypes>
  void swap(packaged_task<R(ArgTypes...)>& x, packaged_task<R(ArgTypes...)>& y) noexcept;
```

Differential Revision: https://reviews.llvm.org/D99102

Added: 
    

Modified: 
    libcxx/include/future

Removed: 
    


################################################################################
diff  --git a/libcxx/include/future b/libcxx/include/future
index db60ab69ecad..40beab18004a 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -2126,10 +2126,10 @@ packaged_task<void(_ArgTypes...)>::reset()
     __p_ = promise<result_type>();
 }
 
-template <class _Callable>
+template <class _Rp, class... _ArgTypes>
 inline _LIBCPP_INLINE_VISIBILITY
 void
-swap(packaged_task<_Callable>& __x, packaged_task<_Callable>& __y) _NOEXCEPT
+swap(packaged_task<_Rp(_ArgTypes...)>& __x, packaged_task<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
 {
     __x.swap(__y);
 }


        


More information about the libcxx-commits mailing list