Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

STL Iterators

Name: Anonymous 2011-11-22 21:14

Do STL iterators need to be deleted when you're done with them? If I remember right, iterators are nothing but pointers that have been gussied up, but do they have their own destructors that clean up all their internal mess? I can't remember for the life of me and google is no help.

Name: Anonymous 2011-11-22 23:45

>>6

If an iterator is a pointer, then an iterator is an object that contains a single pointer, and it will take up some memory, probably the same amount of space as a pointer, but maybe a little more if you do virtual method overriding or other fancy shit with your iterators. The object is object allocated on the stack though, so in that cause, it will be destroyed when it goes out of scope, like any other object allocated on the stack.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List