最終更新日時(UTC):
が更新

履歴 編集

function template
<flat_set>

std::flat_multiset::operator==

friend bool operator==(const flat_multiset& x, const flat_multiset& y);

概要

xy と等しいかどうかの判定を行う。

戻り値

以下と等価:

return equal(x.begin(), x.end(), y.begin(), y.end());

計算量

size() に対して線形時間。ただし、xyのサイズが異なる場合は定数時間。

備考

  • この演算子により、以下の演算子が使用可能になる:
    • operator!=

#include <flat_set>
#include <iostream>

int main()
{
  std::flat_multiset<int> fs1 = {3, 1, 4};

  std::flat_multiset<int> fs2 = {3, 1};

  std::cout << std::boolalpha;
  std::cout << (fs1 == fs1) << std::endl;
  std::cout << (fs1 == fs2) << std::endl;
  std::cout << (fs1 != fs1) << std::endl;
  std::cout << (fs1 != fs2) << std::endl;
}

出力

true
false
false
true

バージョン

言語

  • C++23

処理系