Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2005-04-28 19:29:44


"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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk