palacaze/sigslot

Request: Please promote sigslot::detail::cleanable to main namespace

gamagan opened this issue · 1 comments

Hi,

This library is fantastic.

For my usecase, I'm storing all the signals I create within a map:

std::unordered_map<uint32_t, std::unique_ptr<sigslot::detail::cleanable>> signals;

I noticed that the base class of sigslot::signal_base is within namespace sigslot::details, which probably means that it's not meant to be utilized by users. But, in order to store all the signals within the same collection and still have the virtual destructor called, we have to use this class.

REQUEST:
Please, promote sigslot::detail::cleanable to the sigslot namespace, to make clear that it's ok to derrive from this class for the purpose of treating the signals polymorphically.

Thanks

Hi gamagan,

I cannot commit to keeping this base class. I considered removing it altogether a few months ago while refactoring the disconnection mechanism.
You might solve this differently by using a shared_ptr storing a void* and a custom deleter that casts back to the proper type. This is ugly but works as a poor man's type erasing trick.

If this is not a satisfactory solution for you, I may introduce an official base class.