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