Destructor List<t> question

Hi all,
This may be a silly question but when you declare an list<t> linked list, does the class do the destructing of the list automatically or must you bulid a destructor?
regards
Brendan
I'm assuming you're talking about std::list, the one you have used in the code in your other posts, which does have its own destructor. Although in your implementation this is not an issue, if you are putting pointers into your list you will have to have cleanup code to delete/free the memory used by what the pointers point to. The obvious places for that cleanup code could be a destructor of the class using the list, or a method within the using class.
Last edited on
Thank you for your resonse
regards
Brendan
Topic archived. No new replies allowed.