Skip to content

Commit 85b1169

Browse files
committed
Refactor vector move-ctor with allocator
1 parent 42be165 commit 85b1169

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
@@ -976,9 +976,7 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const __type_identity_t<allocator_
976976
__x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;
977977
} else {
978978
typedef move_iterator<iterator> _Ip;
979-
auto __guard = std::__make_exception_guard(__destroy_vector(*this));
980-
assign(_Ip(__x.begin()), _Ip(__x.end()));
981-
__guard.__complete();
979+
__init_with_size(_Ip(__x.begin()), _Ip(__x.end()), __x.size());
982980
}
983981
}
984982

0 commit comments

Comments
 (0)