Hi, I'm trying to put a simple lambda functor which uses
pointer to member function into a boost::function like this:
struct aux
{
int a() const { return 5; }
};
int main()
{
function f = &_1->*&aux::a;
}
But the compiler chokes at the assignment with the error:
/usr/include/boost/function/function_template.hpp:119: error: cannot
convert 'boost::lambda::detail::member_pointer_caller' to 'int' in return
I think it should be able to convert the member_pointer_caller to
boost::function, as its result (int) is the same of function's result,
as well as its only argument is the one that makes the lambda
functor valid.
According to the documentation, something like this should work because
it says that
boost::function f = _1 + _2
works.
Am I missing something?
Thank you,
Rodolfo Lima.