| 140 | bool IsLast(iterator it) { return it.Position == this->Data.size(); } |
| 141 | |
| 142 | iterator Pop(iterator it) |
| 143 | { |
| 144 | assert(!this->Data.empty()); |
| 145 | assert(this->UpPositions.size() == this->Data.size()); |
| 146 | bool const isLast = this->IsLast(it); |
| 147 | ++it; |
| 148 | // If this is the last entry then no other entry can refer |
| 149 | // to it so we can drop its storage. |
| 150 | if (isLast) { |
| 151 | this->Data.pop_back(); |
| 152 | this->UpPositions.pop_back(); |
| 153 | } |
| 154 | return it; |
| 155 | } |
| 156 | |
| 157 | iterator Truncate() |
| 158 | { |