|
Boost : |
From: Pavel Chikulaev (pavel.chikulaev_at_[hidden])
Date: 2005-03-06 14:20:40
"Matthias Kaeppler" <nospam_at_[hidden]> wrote in message
news:d0ff4g$7rm$1_at_sea.gmane.org...
> Ex.:
> inline int plus( int a, int b )
> {
> return a + b;
> }
>
> std::vector<int> vec;
> // ...
> std::sort(vec.begin(),vec.end(),indirect_binary(std::less<int>()));
std::sort(vec.begin(), vec.end(), std::lest<int>()) works just fine. (I
used VC7.1)
> std::transform(vec.begin(),vec.end(),vec.begin(),std::ostream_iterator<int>(std::cout,"\n"),indirect_binary(plus));
I think it also works with out your indirect_binary.
It's VERY VERY similar to std::mem_fun.
-- Pavel Chikulaev
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk