Posts

Showing posts from April 5, 2019

Is it safe to end destructor with return statement?

Image
8 In my Doubly Linked list class, I am coding my destructor and this is my code: DLinkedList::~DLinkedList() { if(head==NULL){ return; } //other code } My question is, is it safe to end a destructor with return; statement? I know that I can use to end my void functions with return; statement, but this is a destructor. c++ destructor share | improve this question edited 1 hour ago πάντα ῥεῖ 71.9k 9 72 134 asked 1 hour ago levidone 8