S
scooter
std::list::clear() can slow down the performance of a method
considerably if it is called many times a second. I have countered
this problem a little by assigning a fixed size to a list when
instantiated and keeping track of the elements through iterator logic.
This seems a little messy to me though. I'm sure the guys who created
the STL must have a speedier method.
How do you guys clear and reuse a std::list multiple times with as
little slowdown as possible? (where the number of elements to be
inserted each iteration is unknown)
I preferably would like to use lists that have an undetermined size at
runtime.
thanks for any help.
considerably if it is called many times a second. I have countered
this problem a little by assigning a fixed size to a list when
instantiated and keeping track of the elements through iterator logic.
This seems a little messy to me though. I'm sure the guys who created
the STL must have a speedier method.
How do you guys clear and reuse a std::list multiple times with as
little slowdown as possible? (where the number of elements to be
inserted each iteration is unknown)
I preferably would like to use lists that have an undetermined size at
runtime.
thanks for any help.