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 // packaged_task(packaged_task&& other);
21 #include "test_macros.h"
28 explicit A(long i
) : data_(i
) {}
30 long operator()(long i
, long j
) const {return data_
+ i
+ j
;}
36 std::packaged_task
<double(int, char)> p0(A(5));
37 std::packaged_task
<double(int, char)> p
= std::move(p0
);
40 std::future
<double> f
= p
.get_future();
42 assert(f
.get() == 105.0);
45 std::packaged_task
<double(int, char)> p0
;
46 std::packaged_task
<double(int, char)> p
= std::move(p0
);