namespace std {
template <class Key, class Compare, class Allocator>
void
swap(multiset<Key, Compare, Allocator>& x,
multiset<Key, Compare, Allocator>& y); // (1) C++03
template <class Key, class Compare, class Allocator>
void
swap(multiset<Key, Compare, Allocator>& x,
multiset<Key, Compare, Allocator>& y)
noexcept(noexcept(x.swap(y))); // (1) C++17
template <class Key, class Compare, class Allocator>
constexpr void
swap(multiset<Key, Compare, Allocator>& x,
multiset<Key, Compare, Allocator>& y)
noexcept(noexcept(x.swap(y))); // (1) C++26
}
概要
2つのmultisetオブジェクトを入れ替える。
効果
x.swap(y);
計算量
定数時間
例
出力
5,15,
参照
- N4258 Cleaning-up noexcept in the Library, Rev 3
noexcept追加の経緯となる提案文書
- P3372R3 constexpr containers and adaptors