Boost logo

Boost Users :

Subject: Re: [Boost-users] doubt on boost::bind and boost::function
From: Sergey Mitsyn (svm_at_[hidden])
Date: 2010-02-19 10:58:54


Hello,

Probably you've meant boost::arg<n>() ? That's because boost::arg<n> is
a type, and _1 is a variable.

On 19.02.2010 18:09, Conoscenza Silente wrote:
> If I use _1 it seems that there is a conflict with the placehodler of
> boost::lambda
> so I switched to using boost::arg<1> to avoid the conflict but I still
> have an error saying.
>
> TestBoost_Feb18.h:34: error: expected primary-expression before ‘)’ token
>
> If I want to use the placeholders of boos::bind explicitly ( since I am
> using
> explicitly boost::bind ) is boost::arg<n> good?
>
> Below is my code
> #include<boost/bind/placeholders>
> boost::function< bool(const std::string& ) > fooPtr (
> boost::bind( &CA::IsMemberFunction, this, boost::arg<1> ) );
>
>
> On Fri, Feb 19, 2010 at 3:31 PM, Rutger ter Borg <rutger_at_[hidden]
> <mailto:rutger_at_[hidden]>> wrote:
>
> Conoscenza Silente wrote:
>
> > Do you know what I am doing wrong?
> > Is the signature fine?
> > Thanks
>
> try boost::bind( &CA::IsMemberFunction, this, _1 )
>
> Cheers,
>
> Rutger
>
>
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden] <mailto:Boost-users_at_[hidden]>
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

----------------
Sergey Mitsyn.


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