Boost logo

Boost :

Subject: Re: [boost] [Review:Algorithms] Order of args to clamp
From: John Bytheway (jbytheway+boost_at_[hidden])
Date: 2011-09-24 05:04:55


On 24/09/11 01:12, Jeffrey Lee Hellrung, Jr. wrote:
<snip>
> struct less
> {
> typedef bool result_type;
> template< class T, class U >
> bool operator()(T const & x, U const & y) const
> { return x < y; }
> };
>
> for the default comparison function object. I don't think using std::less,
> directly or indirectly, over operator< buys you anything here, does it?

Yes, it does buy you something. std::less defines a total ordering on
pointers, operator< need not. (See N3290 [comparisons] 20.8.5 p8)

John Bytheway


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