[libcxx-commits] [libcxx] [libc++][ranges] LWG3692: `zip_view::iterator`'s `operator<=>` is overconstrained and changes of `zip_view` in P2165R4 (PR #112077)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 11 21:04:50 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 d0606c265e8eb800cc59f182b38b3e0427ba0200 abc7b307a0fd1a3a75912dfc3f94402283aece57 --extensions cpp,h -- libcxx/include/__ranges/zip_view.h libcxx/test/std/ranges/range.adaptors/range.zip/cpo.pass.cpp libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp libcxx/test/std/ranges/range.adaptors/range.zip/iterator/deref.pass.cpp libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp libcxx/test/std/ranges/range.adaptors/range.zip/iterator/subscript.pass.cpp
``````````

</details>

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

``````````diff
diff --git a/libcxx/include/__ranges/zip_view.h b/libcxx/include/__ranges/zip_view.h
index 3ff49b8c1c..835e23cb23 100644
--- a/libcxx/include/__ranges/zip_view.h
+++ b/libcxx/include/__ranges/zip_view.h
@@ -61,8 +61,7 @@ template <class _Fun, class _Tuple>
 _LIBCPP_HIDE_FROM_ABI constexpr auto __tuple_transform(_Fun&& __f, _Tuple&& __tuple) {
   return std::apply(
       [&]<class... _Types>(_Types&&... __elements) {
-        return tuple<invoke_result_t<_Fun&, _Types>...>(
-            std::invoke(__f, std::forward<_Types>(__elements))...);
+        return tuple<invoke_result_t<_Fun&, _Types>...>(std::invoke(__f, std::forward<_Types>(__elements))...);
       },
       std::forward<_Tuple>(__tuple));
 }
@@ -241,8 +240,7 @@ template <bool _Const>
 class zip_view<_Views...>::__iterator : public __zip_view_iterator_category_base<_Const, _Views...> {
   tuple<iterator_t<__maybe_const<_Const, _Views>>...> __current_;
 
-  _LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(
-      tuple<iterator_t<__maybe_const<_Const, _Views>>...> __current)
+  _LIBCPP_HIDE_FROM_ABI constexpr explicit __iterator(tuple<iterator_t<__maybe_const<_Const, _Views>>...> __current)
       : __current_(std::move(__current)) {}
 
   template <bool>
@@ -393,8 +391,7 @@ template <bool _Const>
 class zip_view<_Views...>::__sentinel {
   tuple<sentinel_t<__maybe_const<_Const, _Views>>...> __end_;
 
-  _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(
-      tuple<sentinel_t<__maybe_const<_Const, _Views>>...> __end)
+  _LIBCPP_HIDE_FROM_ABI constexpr explicit __sentinel(tuple<sentinel_t<__maybe_const<_Const, _Views>>...> __end)
       : __end_(__end) {}
 
   friend class zip_view<_Views...>;

``````````

</details>


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


More information about the libcxx-commits mailing list