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