1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-threads
14 // class packaged_task<R(ArgTypes...)>
16 // template <class R, class... ArgTypes>
18 // swap(packaged_task<R(ArgTypes...)>& x, packaged_task<R(ArgTypes...)>& y);
23 #include "test_macros.h"
30 explicit A(long i
) : data_(i
) {}
32 long operator()(long i
, long j
) const {return data_
+ i
+ j
;}
38 std::packaged_task
<double(int, char)> p0(A(5));
39 std::packaged_task
<double(int, char)> p
;
43 std::future
<double> f
= p
.get_future();
45 assert(f
.get() == 105.0);
48 std::packaged_task
<double(int, char)> p0
;
49 std::packaged_task
<double(int, char)> p
;