On Sun, Dec 4, 2016 at 1:33 PM Klemens Morgenstern < klemens.morgenstern@gmx.net> wrote:
In my example, isn't that precisely what would happen - without a cast? Of course this is a rare case, but one that has to be taken into account, I think. Of course you're right, that type erasure can be useful, but for all pointers you have explicit conversions, except if you convert to void*.
No, in your example you emit the same signal from two different emitters, one of type int, the other of type my_button. Each will call the functions connected to whichever emitter you've passed, but neither emitter object is accessed at that time. The only way to access an emitter object passed to connect is by the connection::emitter member function template, which is type-safe. Emil