palacaze / sigslot

A simple C++14 signal-slots implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getter for number of connected slots

Dysl3xik opened this issue · comments

Would it be possible to add a getter to return the number of connected slots?

I think this could also be used in your emit code to skip making a copy of the vector or slots if there are no slots connected.

Hi,

There is no actual copy happening in the emit code in that case, thanks to the copy on write mechanism in place. The COW object will only copy the slot list if it is being written at the time of emission, which will not happen if no slot is connected.