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

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