signals icon indicating copy to clipboard operation
signals copied to clipboard

Copy lvalues instead of referencing them

Open mikezackles opened this issue 4 years ago • 0 comments

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

mikezackles avatar Jan 27 '21 06:01 mikezackles