ivanseidel/LinkedList

feature request: clear + free objects

RyanAveryBSU opened this issue · 1 comments

LinkedList<obj*>* list = new LL():

list->clear(true); does a normal clear but also calls delete() on each item in the list.

An enum of CLEAR_TYPE { DEFAULT = 0, DELETE, FREE } would be nice so if obj it calls delete, if malloc'd char* it calls free.

Its a nice suggestion, but maybe the default behavior of pointers not being destructed is the best for who wants more controll over it.