Boost logo

Boost Users :

From: Jaakko Järvi (jarvi_at_[hidden])
Date: 2006-11-29 23:02:47


On Nov 28, 2006, at 10:44 PM, Haroon Khan wrote:

> Is it possible to bind to the following functions using boost.lamdba
> and if so how?
>
> class some_class
> {
> public:
> some_class operator % (int x) {
> return this
> }
>
> template<typename T> void foo(T x){
> }
> };
>
> I use the examples given in online-documentation but it gives me a lot
> of errors. I'm using VC8 on windows XP.
>

Not exactly sure what you are after but here are a few valid ways:

   some_class s;
   int i;
   ret<some_class>(var(s) % _1)(i);
   bind(&some_class::operator%, var(s), _1)(i);
   bind(&some_class::operator%, &s, _1)(i);
   bind(&some_class::foo<int>, var(s), _1)(i);
   bind(&some_class::foo<int>, &s, _1)(i);

Cheers, Jaakko

> Thanks, Haroon
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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