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

履歴 編集

function template
<array>

std::operator>=(C++11)

namespace std {
  // operator<=>により、以下の演算子が使用可能になる (C++20)
  template <class T, size_t N>
  bool operator>=(const array<T, N>& x, const array<T, N>& y);           // C++11

  template <class T, size_t N>
  constexpr bool operator>=(const array<T, N>& x, const array<T, N>& y); // C++20
}

概要

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

戻り値

!(x < y)

計算量

線形時間

#include <iostream>
#include <array>

int main ()
{
  std::array<int, 3> x = {4, 5, 6};
  std::array<int, 3> y = {1, 2, 3};

  if (x >= y) {
    std::cout << "greater equal" << std::endl;
  }
  else {
    std::cout << "less" << std::endl;
  }
}

出力

greater equal

バージョン

言語

  • C++11

処理系

参照