mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-31 17:52:27 +00:00
Make more CTL fixes
This commit is contained in:
parent
61370983e1
commit
d0cd719375
4 changed files with 122 additions and 15 deletions
|
@ -411,16 +411,17 @@ class vector
|
|||
return erase(pos, pos + 1);
|
||||
}
|
||||
|
||||
iterator erase(const_iterator first, const_iterator last)
|
||||
constexpr iterator erase(const_iterator first, const_iterator last)
|
||||
{
|
||||
difference_type index = first - begin();
|
||||
difference_type count = last - first;
|
||||
iterator it = begin() + index;
|
||||
ctl::move(it + count, end(), it);
|
||||
for (iterator move_it = it + count; move_it != end(); ++move_it, ++it)
|
||||
*it = ctl::move(*move_it);
|
||||
for (difference_type i = 0; i < count; ++i)
|
||||
ctl::allocator_traits<Allocator>::destroy(alloc_, end() - i - 1);
|
||||
size_ -= count;
|
||||
return it;
|
||||
return begin() + index;
|
||||
}
|
||||
|
||||
void push_back(const T& value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue