Skip to content

Commit e81abcc

Browse files
committed
Refactor vector move-ctor with allocator
1 parent c94d715 commit e81abcc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

libcxx/include/__vector/vector.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,9 +964,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const __type_identity_t<allocator_
964964
__x.__begin_ = __x.__end_ = __x.__cap_ = nullptr;
965965
} else {
966966
typedef move_iterator<iterator> _Ip;
967-
auto __guard = std::__make_exception_guard(__destroy_vector(*this));
968-
assign(_Ip(__x.begin()), _Ip(__x.end()));
969-
__guard.__complete();
967+
__init_with_size(_Ip(__x.begin()), _Ip(__x.end()), __x.size());
970968
}
971969
}
972970

0 commit comments

Comments
 (0)