Hello all,
I'm using boost::signals2 on my application.
When I try to make a connection between a signal and a slot, both taking the same arguments. I get a compilation error.
I reduced the code to a mininum reproducible example:
Code:
#include <boost/signals2.hpp>
class dest {
public:
dest() {}
~dest() {}
void pslot(int *x , int i) {
*x += i;
}
};
class caller {
private:
dest *pd;
public:
caller() {}
~caller() { }
boost::signals2::signal<void(int * , int)> sigEv;
void init() {
pd = new dest;
sigEv.connect( boost::bind(&dest::pslot,pd) ); // <--- this line triggers the error
}
};
This is the error I get, instantiated from the line that I indicate in the comment.
target/usr/include/boost/bind/mem_fn.hpp:342: error: invalid use of non-static member function
This is probably some silly error but I can't figure it out.
Can anyone help me?
Many thanks!
--to