I do have doubt regading use of delete p . In most of the scenarios we call delete inside the destructor if we would have called something int *p = new int (10); but as per below code snippet (original code of delete p)
it already invoke the destructor then call the operator delete then why we should call delete p inside the

// Original code: delete a;
if (a != NULL) {
  operator delete(a);

code snippet where we call the delete a inside destructor

class B
int *a;
a=new int(90);

cout<<"B's destructor";
delete a;

void dial()

cout<<"dial the tone";


Sorry if I might be wrong but what I have done is to create a ::destroy() function then I can choose to destroy and handle the deallocation of variables when I choose to do so. Preventing double deletion when the program exits and calls the destructor.