namespace std {
template <class Key, class Compare, class Allocator>
bool operator==(const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y);
}
概要
x
が y
と等しいかどうかの判定を行う。
戻り値
- C++03 :
x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
- C++14 :
equal(x.begin(), x.end(), y.begin(), y.end());
計算量
size()
に対して線形時間。ただし、x
とy
のサイズが異なる場合は定数時間。
例
出力
1
0
参照
- LWG Issue 2257. Simplify container requirements with the new algorithms
- C++14から、2つ目の範囲のendイテレータをとる
equal()
アルゴリズムを使用するようになった。
- C++14から、2つ目の範囲のendイテレータをとる