[libcxx-commits] [libcxx] [libc++] Rename __construct_one_at_end to __emplace_back_assume_capacity (PR #132276)
Peng Liu via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Mar 24 10:24:54 PDT 2025
================
@@ -1152,7 +1156,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline
vector<_Tp, _Allocator>::emplace_back(_Args&&... __args) {
pointer __end = this->__end_;
if (__end < this->__cap_) {
- __construct_one_at_end(std::forward<_Args>(__args)...);
+ __emplace_back_assume_capacity(std::forward<_Args>(__args)...);
----------------
winner245 wrote:
The new name `__emplace_back_assume_capacity` is much clearer and more descriptive. While `__construct_at_end` is widely used in <vector>, `__construct_one_at_end` appears in 5 places. So I think we can replace the confusing name `__construct_one_at_end` by `__emplace_back_assume_capacity to improve clarity`.
https://github.com/llvm/llvm-project/pull/132276
More information about the libcxx-commits
mailing list