C++ question: boost::bind receive other boost::bind
- by user355034
I want to make this code work properly, what should I do?
giving this error on the last line.
what am I doing wrong?
i know boost::bind need a type but i'm not getting. help
class A
{
public:
template <class Handle>
void bindA(Handle h)
{
h(1, 2);
}
};
class B
{
public:
void bindB(int number, int number2)
{
std::cout << "1 " << number << "2 " << number2 << std::endl;
}
};
template
struct Wrap_
{
Wrap_(Han h) : h_(h) {}
template<typename Arg1, typename Arg2> void operator()(Arg1 arg1, Arg2 arg2)
{
h_(arg1, arg2);
}
Han h_;
};
template
inline Wrap_<Handler> make(Handler h)
{
return Wrap_<Handler> (h);
}
int main()
{
A a;
B b;
((boost::bind)(&B::bindB, b, _1, _2))(1, 2);
((boost::bind)(&A::bindA, a, make(boost::bind(&B::bindB, b, _1, _2))))();
/i want compiled success and execute success this code/
}