Insert before *this realocation.

Pages: 123
Just call the methods that do the work from the dtor.
Would there even be a need for a delete function, even if I allocated a new list with new, as long as I have my Remove() and my other function that will iterate through the entire list and remove each node?
If you mean the dtor yes. If the objects arent manually deleted they need
to be deleted by dtor at exit or end of scope. Atleast this is how I understand it.
Yes I understand that, but what code would the destructor function include if I already have defined a remove node function and a "destroy entire list" function?
I would put a call to the "destroy entire list" method in dtor.
Last edited on
That's what I was thinking. But the brief I'm working off clearly uses delete and then the "destroy entire list function". My thought is that it was redundant and one could use the same code for the destructor and Remove() function. I just wanted to get your opinions on that...
Last edited on
Topic archived. No new replies allowed.
Pages: 123