David Sankel wrote:
No, there should only be one signal type and Boost.Signal made the correct choice of using a so-called intrusive design.
I'm curious whether you can justify this opinion, because the answer is not
as obvious to me. In fact, on its surface, the non-intrusive design is so
much more flexible that one naturally tends to view it as the correct one.
For example, Boost.Signal works well for this design:
class window
{
private:
// state
public:
window( ... );
~window();
// ...
};
We just need to add a few signals at //...:
signal
No, there should only be one signal type...
Except there isn't; but with Synapse, you can add a bit of scaffolding so that a library that uses its own signal type (or uses no signals at all but some other way of communicating, such as Windows messages or C callbacks) emits Synapse signals. Since you don't need to solve the problem of where to put the signal<> object, this is a relatively easy task. Whether the Synapse approach is clearly better may be arguable; whether it's a legitimate alternative design isn't.