fix error in insert
This commit is contained in:
@ -368,7 +368,7 @@ class vector {
|
||||
raw_end = raw_beg + current_length;
|
||||
allocated_length = new_allocated_length;
|
||||
}
|
||||
for (T *i = raw_end - 1; i != pos.raw_pointer; --i) {
|
||||
for (T *i = raw_end; i != pos.raw_pointer; --i) {
|
||||
std::allocator_traits<decltype(alloc)>::construct(alloc, i, std::move(*(i - 1)));
|
||||
std::allocator_traits<decltype(alloc)>::destroy(alloc, i - 1);
|
||||
}
|
||||
@ -398,7 +398,7 @@ class vector {
|
||||
raw_end = raw_beg + current_length;
|
||||
allocated_length = new_allocated_length;
|
||||
}
|
||||
for (T *i = raw_end - 1; i != raw_beg + ind; --i) {
|
||||
for (T *i = raw_end; i != raw_beg + ind; --i) {
|
||||
alloc.construct(i, std::move(*(i - 1)));
|
||||
alloc.destroy(i - 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user