Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 656 Bytes

File metadata and controls

48 lines (33 loc) · 656 Bytes

operator<=

  • vector[meta header]
  • std[meta namespace]
  • function template[meta id-type]
namespace std {
  template <class T, class Allocator>
  bool operator<=(const vector<T, Allocator>& x, const vector<T, Allocator>& y);
}

概要

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

戻り値

!(a > b)

計算量

線形時間

#include <iostream>
#include <vector>

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

  std::cout << std::boolalpha;

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

出力

true

参照