[libcxx-commits] [libcxx] WIP: Implement std::ranges::view_interface<D>::cbegin/cend (PR #174690)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jan 6 19:46:44 PST 2026
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 origin/main HEAD --extensions h -- libcxx/include/__ranges/view_interface.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__ranges/view_interface.h b/libcxx/include/__ranges/view_interface.h
index 72040f733..8247f7c73 100644
--- a/libcxx/include/__ranges/view_interface.h
+++ b/libcxx/include/__ranges/view_interface.h
@@ -150,37 +150,37 @@ public:
return *ranges::prev(ranges::end(__derived()));
}
-#if _LIBCPP_STD_VER >= 23
+# if _LIBCPP_STD_VER >= 23
template <class _D2 = _Derived>
- _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) cbegin()
- requires input_range<_D2>
+ _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) cbegin()
+ requires input_range<_D2>
{
return *ranges::cbegin(__derived());
}
template <class _D2 = _Derived>
_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) cbegin() const
- requires input_range<const _D2>
+ requires input_range<const _D2>
{
return *ranges::cbegin(__derived());
}
template <class _D2 = _Derived>
- _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) cend()
- requires input_range<_D2>
+ _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) cend()
+ requires input_range<_D2>
{
return *ranges::cend(__derived());
}
template <class _D2 = _Derived>
_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) cend() const
- requires input_range<const _D2>
+ requires input_range<const _D2>
{
return *ranges::cend(__derived());
}
-#endif // _LIBCPP_STD_VER >= 23
+# endif // _LIBCPP_STD_VER >= 23
template <random_access_range _RARange = _Derived>
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/174690
More information about the libcxx-commits
mailing list