[libcxx-commits] [libcxx] Unify naming of internal pointer members in std::vector and std::__split_buffer (PR #115517)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 8 09:02:27 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 6737ba40406030cd8a7ea706cd56302f8be7a4b4 d49930cca85dac7c68b5217d6b62007b5130a3d3 --extensions ,h -- libcxx/include/__split_buffer libcxx/include/__vector/vector.h libcxx/include/deque
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer
index 419eee2388..9642cd4c2c 100644
--- a/libcxx/include/__split_buffer
+++ b/libcxx/include/__split_buffer
@@ -340,7 +340,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __sta
     __cap             = __allocation.count;
   }
   __begin_ = __end_ = __first_ + __start;
-  __cap_        = __first_ + __cap;
+  __cap_            = __first_ + __cap;
 }
 
 template <class _Tp, class _Allocator>
@@ -361,7 +361,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator>::__split_buffer(__
   __c.__first_   = nullptr;
   __c.__begin_   = nullptr;
   __c.__end_     = nullptr;
-  __c.__cap_ = nullptr;
+  __c.__cap_     = nullptr;
 }
 
 template <class _Tp, class _Allocator>
@@ -372,16 +372,16 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __al
     __first_       = __c.__first_;
     __begin_       = __c.__begin_;
     __end_         = __c.__end_;
-    __cap_     = __c.__cap_;
+    __cap_         = __c.__cap_;
     __c.__first_   = nullptr;
     __c.__begin_   = nullptr;
     __c.__end_     = nullptr;
-    __c.__cap_ = nullptr;
+    __c.__cap_     = nullptr;
   } else {
     auto __allocation = std::__allocate_at_least(__alloc_, __c.size());
     __first_          = __allocation.ptr;
     __begin_ = __end_ = __first_;
-    __cap_        = __first_ + __allocation.count;
+    __cap_            = __first_ + __allocation.count;
     typedef move_iterator<iterator> _Ip;
     __construct_at_end(_Ip(__c.begin()), _Ip(__c.end()));
   }
@@ -398,7 +398,7 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
   __first_   = __c.__first_;
   __begin_   = __c.__begin_;
   __end_     = __c.__end_;
-  __cap_ = __c.__cap_;
+  __cap_     = __c.__cap_;
   __move_assign_alloc(__c, integral_constant<bool, __alloc_traits::propagate_on_container_move_assignment::value>());
   __c.__first_ = __c.__begin_ = __c.__end_ = __c.__cap_ = nullptr;
   return *this;

``````````

</details>


https://github.com/llvm/llvm-project/pull/115517


More information about the libcxx-commits mailing list