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

履歴 編集

function template
<queue>

std::operator<=

namespace std {
  template <class T, class Container>
  bool operator<=(const queue<T, Container>& x, const queue<T, Container>& y);
}

概要

queueにおいて、左辺が右辺以下かを判定する。

戻り値

x.c <= y.c

#include <iostream>
#include <queue>

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

  std::queue<int> y;
  y.push(4);
  y.push(5);
  y.push(6);

  std::cout << std::boolalpha << (x <= y) << std::endl;
}

出力

true

参照