Boost logo

Boost Users :

Subject: [Boost-users] boost::lambda: how to create indirect functor
From: _at_[hidden]
Date: 2009-02-05 03:22:57


prerequisites:

struct C {
        void func(int i) {}
};

void indirect(boost::function<void(C*)> f)
{
        static C c;
        f(&c);
}

I need a functor that takes int and calls "indirect" passing there &C::func
bound with that int.

I imagine a solution like:

boost::function<void(int)> result_functor = bind(indirect, bind(&C::func,
protect(_1), _1));

receiving compilation error: "could not deduce argument" deep inside lambda
library

thanks

-- 
View this message in context: http://www.nabble.com/boost%3A%3Alambda%3A-how-to-create-indirect-functor-tp21836171p21836171.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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