signals
signals copied to clipboard
Copy lvalues instead of referencing them
If it is of interest, I've made an attempt at resolving #20. I can't say I'm 100% confident in this code, but the basic test suite passes (with address/undefined behavior sanitizers). Thanks!
signal::connect has been reworked. It now does one of the following 3:
- Stores a function pointer if the callable can be converted to one
- Constructs the callable in the pointer's memory via perfect forwarding
- Constructs the callable on the heap via perfect forwarding
One relevant test in main.cpp has been updated, and a memory leak in another test was fixed.
Also marks conn_nontrivial destructor as an override