Boost logo

Boost :

From: Matthias Kaeppler (nospam_at_[hidden])
Date: 2005-03-06 17:14:37


Pavel Chikulaev wrote:
> Now std::sort(vec.begin(), vec.end(), std::less<int>()) won't work.

No, why should it? It's a collection of pointers to int, not of int.

> But I can do it with Boost::Bind:
> std::sort(vec.begin(), vec.end(), boost::bind(std::less<int>(), *_1,
> *_2));

This looks new to me. What exactly does this do? Sort the container of
pointers by applying std::less to the pointees?

>
> Boost::Bind's solution is much better that yours, because it constists
> indirector_unary, indirector_binary, indirector_ternary and so on.
>
> Pavel Chikulaev
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

-- 
Matthias Kaeppler

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