Optimization

Hi i have function which works with some linked list, the type of linked list is user defined data type which consist of vector, linked list, string ...
my question is when my function end work, a lot of time required to call destructors of my linked list(the count of items of linked list can be more than 100 000). my question is how i can optimize it, or is there some ways to exit from function without calling destructors?
If the list is a parameter, you should pass it as reference
no list is not a parameter, it is created in this function. any other ideas?
You wouldn't want to exit the function without calling dtors. That would open up tremendous memory leaks.

It's hard to say how to optimize without knowing exactly what it is you're doing. Can you elaborate a little bit more? What does this function do, and why do you need a list of 100000+ elements?
Topic archived. No new replies allowed.