… | |
… | |
256 | return pos; |
256 | return pos; |
257 | } |
257 | } |
258 | void erase (iterator first, iterator last) |
258 | void erase (iterator first, iterator last) |
259 | { |
259 | { |
260 | if (last != first) { |
260 | if (last != first) { |
261 | memmove (first, last, (end ()-last)*sizeof (T)); |
261 | memmove (first, last, (end () - last) * sizeof (T)); |
262 | _last -= last - first; |
262 | _last -= last - first; |
263 | } |
263 | } |
264 | } |
264 | } |
265 | void erase (iterator pos) |
265 | void erase (iterator pos) |
266 | { |
266 | { |
267 | if (pos != end ()) { |
267 | if (pos != end ()) { |
268 | memmove (pos, pos+1, (end ()- (pos+1))*sizeof (T)); |
268 | memmove (pos, pos+1, (end () - (pos+1)) * sizeof (T)); |
269 | --_last; |
269 | --_last; |
270 | } |
270 | } |
271 | } |
271 | } |
272 | void swap (simplevec<T> &t) |
272 | void swap (simplevec<T> &t) |
273 | { |
273 | { |