void swap(basic_stringbuf& rhs); // (1) C++11
void swap(basic_stringbuf& rhs) noexcept(see below); // (1) C++20
概要
値を交換する。
効果
basic_streambuf<CharT, Traits>::swap(rhs)を呼び出し、modeと内部の文字列バッファをrhsと交換する。
例外
- C++20 :
noexcept(see below)のsee belowは以下と等価であるallocator_traits<Allocator>::propagate_on_container_swap::value || allocator_traits<Allocator>::is_always_equal::value。
例
出力
second
first
バージョン
言語
- C++11
処理系
- Clang: 3.0 ✅
- GCC: 5.1.0 ✅
- ICC: ??
- Visual C++: ??