Skip to content

Commit d38b35d

Browse files
committed
Return to using _ConstructTransaction
1 parent 951ae13 commit d38b35d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

libcxx/include/__vector/vector.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,9 @@ class _LIBCPP_TEMPLATE_VIS vector {
465465
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __emplace_back_assume_capacity(_Args&&... __args) {
466466
_LIBCPP_ASSERT_INTERNAL(
467467
size() < capacity(), "We assume that we have enough space to insert an element at the end of the vector");
468-
__alloc_traits::construct(this->__alloc_, std::__to_address(this->__end_), std::forward<_Args>(__args)...);
469-
++this->__end_;
470-
#if _LIBCPP_HAS_ASAN
471-
__annotate_increase(1);
472-
#endif
468+
_ConstructTransaction __tx(*this, 1);
469+
__alloc_traits::construct(this->__alloc_, std::__to_address(__tx.__pos_), std::forward<_Args>(__args)...);
470+
++__tx.__pos_;
473471
}
474472

475473
#if _LIBCPP_STD_VER >= 23

0 commit comments

Comments
 (0)