Changeset 1195


Ignore:
Timestamp:
Oct 4, 2010, 2:26:55 AM (11 years ago)
Author:
Peter Johansson
Message:

refs #475, erase elements in underlying map (when possible) when resizing Vector.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Vector.h

    r1194 r1195  
    6060    T back(void) const
    6161    {
    62       // FIXME: avoid logN lookup time
    6362      assert(size()>0);
    6463      return (*this)[size()-1];
     
    110109    {
    111110      size_ = size;
     111      // remove elements with rev [size, inf)
     112      typename Map::iterator i = map_.lower_bound(size);
     113      map_.erase(i, map_.end());
    112114    }
    113115
Note: See TracChangeset for help on using the changeset viewer.