Boost logo

Boost :

Subject: Re: [boost] Synapse library review starts today December 2
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2016-12-04 18:39:06


On Sun, Dec 4, 2016 at 1:33 PM Klemens Morgenstern <
klemens.morgenstern_at_[hidden]> 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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk