1 | //===----------------------------------------------------------------------===// |
2 | // |
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 |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // |
9 | // UNSUPPORTED: no-threads |
10 | // UNSUPPORTED: libcpp-has-no-experimental-stop_token |
11 | // UNSUPPORTED: c++03, c++11, c++14, c++17 |
12 | // XFAIL: availability-synchronization_library-missing |
13 | |
14 | // stop_callback(const stop_callback&) = delete; |
15 | // stop_callback(stop_callback&&) = delete; |
16 | // stop_callback& operator=(const stop_callback&) = delete; |
17 | // stop_callback& operator=(stop_callback&&) = delete; |
18 | |
19 | #include <stop_token> |
20 | #include <type_traits> |
21 | |
22 | struct Callback { |
23 | void operator()() const; |
24 | }; |
25 | |
26 | static_assert(!std::is_copy_constructible_v<std::stop_callback<Callback>>); |
27 | static_assert(!std::is_move_constructible_v<std::stop_callback<Callback>>); |
28 | static_assert(!std::is_copy_assignable_v<std::stop_callback<Callback>>); |
29 | static_assert(!std::is_move_assignable_v<std::stop_callback<Callback>>); |
30 | |