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

履歴 編集

function template
<queue>

std::operator<=>(C++20)

namespace std {
  template <class T, class Container>
  compare_three_way_result_t<Container>
    operator<=>(const queue<T, Container>& x,
                const queue<T, Container>& y); // (1) C++20
}

概要

queueの三方比較を行う

戻り値

return x.c <=> y.c;

#include <cassert>
#include <queue>

int main ()
{
  std::queue<int> x;
  x.push(1);
  x.push(2);
  x.push(3);

  std::queue<int> y;
  y.push(1);
  y.push(2);
  y.push(3);

  assert((x <=> y) == 0);
}

出力

バージョン

言語

  • C++20

処理系

参照