class Widget
{
public:
Widget() {
cout<<\"~Widget()\"<
Would like a leave a comment, instead of answer, didn't have enough privileges being a new member.
An exception is being raised during the creation of object. The destructor is not getting called, as the object itself is not created.
That you can also observe, as the messages from the constructor & destructor are not getting displayed.
But, the delete is being called when the destructor is not defined. If thought in the directon that when destrcutor is not defined, C++ Compiler considers it as any other operator, the compiler by default provides a destructor when not defined.