In ref, they have this line of code
Widget *aWidget = new BorderDecorator(new BorderDecorator(new ScrollDecorator
(new TextField(80, 24))));
Two questions:
Say, I want to explicitly delete the objects created with new. How do you do that?
BTW, If I just add
delete aWidget;
I get warning: deleting object of abstract class type 'Widget' which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]
Second related question:
How do you write this nested news with unique_ptr
Thanks