Thread: vector<object>::iterator Help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> it removes an element from the container, it just doesn't destroy the element.

    That sentence is misleading. If it removed the element(s) from the container, then if you check size() after the call to remove it would be different, but it is not. It does not actually remove elements from the container or destroy them, it simply manipulates the contents of the container so that you can actually remove those items if you choose to do so.

  2. #2
    Registered User
    Join Date
    Feb 2006
    Posts
    312
    Quote Originally Posted by Daved
    That sentence is misleading. If it removed the element(s) from the container, then if you check size() after the call to remove it would be different, but it is not. It does not actually remove elements from the container or destroy them, it simply manipulates the contents of the container so that you can actually remove those items if you choose to do so.
    My bad then For some reason I thought it changed the ordering of the container, ajoining the 2 elements either side of the one to be erased.

Popular pages Recent additions subscribe to a feed