Boost logo

Boost Users :

From: Manfred Doudar (manfred.doudar_at_[hidden])
Date: 2006-08-10 01:41:43


Replying to my own post here, apologies all, what was I thinking ::_1 is
just a place holder.

However, I'd much like to achieve something along similar lines .. all
help appreciated.

-- 
Manfred
Manfred Doudar wrote:
> 
> 
> Hello all:
> 
> Hoping someone might help with a simple problem; how I might call a 
> member on a boost::bind placeholder, see below ...
> 
> 
> #include <list>
> 
> class Xtype
> {
> public:
> 
>    Xtype(int v)
>    : value_(v)
>    {
>    }
> 
>    int the_value() const
>    {
>       return this->value_;
>    }
> 
> private:
> 
>    int value_;
> };
> 
> 
> 
> template <typename Predicate>
> class Excise
> {
> public:
> 
>   void operator()(std::list<Xtype>& li) const
>   {
>      li.remove_if(boost::bind(Predicate(), ::_1, 10));
>   }
> };
> 
> 
> 
> ... what I really want is something more like [, note the call of 
> Xtype::this_value() ]:
> 
> 
> void operator()(std::list<Xtype>& li) const
> {
>    li.remove_if(boost::bind(Predicate(), ::_1.the_value(), 10));
> }
> 
> 
> But how do I achieve that (, if at all possible); as seemingly 
> ::_1.the_value() is illegal/invalid code ?
> 
> 
> Thanks in advance,

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net