[libcxx-commits] [libcxx] [libc++] Remove redundant __append declaration in vector<bool> (PR #121673)
Peng Liu via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jan 4 17:21:51 PST 2025
https://github.com/winner245 created https://github.com/llvm/llvm-project/pull/121673
The `vector<bool>` implementation in libcxx contains a declaration of a private `__append` function, which is neither defined nor used anywhere in the codebase. This PR aims to remove this declaration, as its presence is misleading and could lead to confusion during future maintenance.
I have no idea why we have a declaration without a definition. My guess is that the declaration might be inherited from the implementation of `vector<T>`, where `__append` is both necessary and properly defined. The declaration may have been inadvertently copied from `vector<T>` to `vector<bool>` and subsequently abandoned, as `vector<bool>` never needs it.
>From fafc1bd59e163dcd501eb102ba8396596616fd52 Mon Sep 17 00:00:00 2001
From: Peng Liu <winner245 at hotmail.com>
Date: Sat, 4 Jan 2025 19:59:51 -0500
Subject: [PATCH] Remove redundant __append() declaration
---
libcxx/include/__vector/vector_bool.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/libcxx/include/__vector/vector_bool.h b/libcxx/include/__vector/vector_bool.h
index 525fc35b26cc9e..8658745b8a8f9e 100644
--- a/libcxx/include/__vector/vector_bool.h
+++ b/libcxx/include/__vector/vector_bool.h
@@ -442,7 +442,6 @@ class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator> {
template <class _InputIterator, class _Sentinel>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
__construct_at_end(_InputIterator __first, _Sentinel __last, size_type __n);
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void __append(size_type __n, const_reference __x);
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference __make_ref(size_type __pos) _NOEXCEPT {
return reference(__begin_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);
}
More information about the libcxx-commits
mailing list