3 ms·
I think it should work if you define the ctor and dtor for BlackBox in a separate .cpp file where you include gadget.h. The reason it fails to compile is proba
by nice_byte 11y ago
I think it should work if you define the ctor and dtor for BlackBox in a separate .cpp file where you include gadget.h.
The reason it fails to compile is probably that the implicitly generate constructor of BlackBox (which is inline, I guess) may need to call the dtor of unique_ptr in case something in the constructor throws an exception.
- ridiculous_fish 11y agoYou're right, that works! Thanks, I would not have arrived at that on my own.