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
18struct Callback {
19 void operator()() const;
20};
21
22static_assert(std::is_same_v<std::stop_callback<Callback>::callback_type, Callback>);
23static_assert(std::is_same_v<std::stop_callback<const Callback>::callback_type, const Callback>);
24static_assert(std::is_same_v<std::stop_callback<Callback&>::callback_type, Callback&>);
25static_assert(std::is_same_v<std::stop_callback<const Callback&>::callback_type, const Callback&>);
26static_assert(std::is_same_v<std::stop_callback<Callback&&>::callback_type, Callback&&>);
27static_assert(std::is_same_v<std::stop_callback<const Callback&&>::callback_type, const Callback&&>);
28

source code of libcxx/test/std/thread/thread.stoptoken/stopcallback/typedef.compile.pass.cpp