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 | |
13 | // using callback_type = _Callback; |
14 | |
15 | #include <stop_token> |
16 | #include <type_traits> |
17 | |
18 | struct Callback { |
19 | void operator()() const; |
20 | }; |
21 | |
22 | static_assert(std::is_same_v<std::stop_callback<Callback>::callback_type, Callback>); |
23 | static_assert(std::is_same_v<std::stop_callback<const Callback>::callback_type, const Callback>); |
24 | static_assert(std::is_same_v<std::stop_callback<Callback&>::callback_type, Callback&>); |
25 | static_assert(std::is_same_v<std::stop_callback<const Callback&>::callback_type, const Callback&>); |
26 | static_assert(std::is_same_v<std::stop_callback<Callback&&>::callback_type, Callback&&>); |
27 | static_assert(std::is_same_v<std::stop_callback<const Callback&&>::callback_type, const Callback&&>); |
28 | |