Signal library that automatically tracks slot lifetime
I need a C ++ C ++ library with one specific quirk that automatically mutes the signal when an object with a slot is destroyed.
Boost :: signals2 only offers this feature for an object created with boost :: shared_ptr, and I want to keep using std :: shared_ptr everywhere. There is a possibility to make it work with std :: shared_ptr, but it requires writing some specialized templates and there is no information on how this should please and generally I would rather avoid it (unless the code is not available somewhere on the internet, but I couldn't find it).
I know Qt signals have this feature, but Qt is too big to use in every project.
source to share
I suggest taking a look at the sigslot library - http://sigslot.sourceforge.net
It is a simple mechanism that does not require a preprocessor (such as Qt signals) and provides automatic disabling of remote slots.
source to share