Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.22 KB

File metadata and controls

55 lines (41 loc) · 1.22 KB

operator>=

  • vector[meta header]
  • std[meta namespace]
  • function template[meta id-type]
namespace std {
  // operator<=>により、以下の演算子が使用可能になる (C++20)
  template <class T, class Allocator>
  bool operator>=(const vector<T, Allocator>& x,
                  const vector<T, Allocator>& y);           // (1) C++03

  template <class T, class Allocator>
  constexpr bool operator>=(const vector<T, Allocator>& x,
                            const vector<T, Allocator>& y); // (1) C++20
}

概要

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

戻り値

!(x < y)

計算量

線形時間

#include <iostream>
#include <vector>

int main ()
{
  std::vector<int> v1 = {4, 5, 6};
  std::vector<int> v2 = {1, 2, 3};

  std::cout << std::boolalpha;

  std::cout << (v1 >= v2) << std::endl;
}

出力

true

参照