K
KS
Hello,
I have a loop in which I need to keep two vectors, oldVector and
newVector. The elements of oldVector are processed and new elements are
added to newVector. At the end of the loop I simply do "oldVector =
newVector" for the next iteration. My question is does is assignment
destroy the contents of the oldVector and copy the new elements of
newVector? Its good if thats whats happenning, but if not, it is a huge
memory leak.
I looked at the source of vector and its not very clear what happens in
this case. (There are two functions copy and uninitialized copy which
are not available for viewing).
KS
I have a loop in which I need to keep two vectors, oldVector and
newVector. The elements of oldVector are processed and new elements are
added to newVector. At the end of the loop I simply do "oldVector =
newVector" for the next iteration. My question is does is assignment
destroy the contents of the oldVector and copy the new elements of
newVector? Its good if thats whats happenning, but if not, it is a huge
memory leak.
I looked at the source of vector and its not very clear what happens in
this case. (There are two functions copy and uninitialized copy which
are not available for viewing).
KS