- stop_token[meta header]
- std[meta namespace]
- inplace_stop_token[meta class]
- function[meta id-type]
- cpp26[meta cpp]
void swap(inplace_stop_token&) noexcept;他のinplace_stop_tokenオブジェクトと値を入れ替える。
なし
投げない
#include <cassert>
#include <stop_token>
int main()
{
std::inplace_stop_source ss;
std::inplace_stop_token st1 = ss.get_token();
std::inplace_stop_token st2;
assert(st1.stop_possible() == true);
assert(st2.stop_possible() == false);
st1.swap(st2);
assert(st1.stop_possible() == false);
assert(st2.stop_possible() == true);
}- swap[color ff0000]
- std::inplace_stop_token[link ../inplace_stop_token.md]
- std::inplace_stop_source[link ../inplace_stop_source.md]
- stop_possible()[link stop_possible.md]
- C++26
- Clang: ??
- GCC: ??
- Visual C++: ??