
29 Apr
2005
29 Apr
'05
12:29 a.m.
"Jan Gaspar" wrote:
I realized there is no reason to implement the comparison operators - functions std::equal() and std::lexicographical_compare() do the job.
std::vector<int> v; v.push_back(1); v.push_back(2); v.push_back(3);
std::deque<short> d; d.push_back(1); d.push_back(2); d.push_back(3);
std::lexicographical_compare(v.begin(), v.end(), d.begin(), d.end());
std::equal(v.begin(), v.end(), d.begin());
Generic code may require operator ==(). /Pavel