I'm trying to do this:
boost::signals::connection c = somesignal.connect(
[c]()->void{
// Do something
c.disconnect();
})
Will this cause problems?
The connection c is assigned only after connect.
lambda needs to be initialized before connect.
It seems capture by value would not work. However, I can not capture by reference, since c is only a local variable.
If it is not a lambda, I can capture the "somesignal", and call somesignal.disconnect(slot). But in the case of a lambda, the slot is itself.