namespace std {
template <class T, class Allocator>
bool operator<(const deque<T, Allocator>& x, const deque<T, Allocator>& y);
}
概要
deque
において、左辺が右辺より小さいかの判定を行う。
要件
型T
が<
比較可能であること。その<
が全順序関係を持っていること。
戻り値
lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
計算量
線形時間
例
#include <iostream>
#include <deque>
int main ()
{
std::deque<int> c1 = {1, 2, 3};
std::deque<int> c2 = {4, 5, 6};
std::cout << std::boolalpha;
std::cout << (c1 < c2) << std::endl;
}
出力
true