[libcxx-commits] [libcxx] [libcxx] Added segment iterator for fill (PR #104680)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 17 13:01:29 PDT 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 362142c4bb5cc657151f592e507f552d5b9f7dde 37dab9d3dfc627b8ca7b14ad3475caab2c4f81cd --extensions h -- libcxx/include/__algorithm/fill.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__algorithm/fill.h b/libcxx/include/__algorithm/fill.h
index b8d893e2ee..c2481342a7 100644
--- a/libcxx/include/__algorithm/fill.h
+++ b/libcxx/include/__algorithm/fill.h
@@ -22,10 +22,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// fill isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.
-template <
- class _ForwardIterator,
- class _Tp,
- __enable_if_t<!__has_random_access_iterator_category<_ForwardIterator>::value, int> = 0>
+template < class _ForwardIterator,
+ class _Tp,
+ __enable_if_t<!__has_random_access_iterator_category<_ForwardIterator>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
for (; __first != __last; ++__first)
@@ -35,7 +34,8 @@ __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
template <class _RandomAccessIterator,
class _Tp,
__enable_if_t<__has_random_access_iterator_category<_RandomAccessIterator>::value &&
- !__is_segmented_iterator<_RandomAccessIterator>::value, int> = 0>
+ !__is_segmented_iterator<_RandomAccessIterator>::value,
+ int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value) {
std::fill_n(__first, __last - __first, __value);
``````````
</details>
https://github.com/llvm/llvm-project/pull/104680
More information about the libcxx-commits
mailing list