[compiler-rt] [libc++] Implement ranges::iota (PR #68494)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 14:09:46 PDT 2023


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 c9e8b73694131d2d9cc9224734122ec658937dd4 e658ec2da49c30dbc6bab990935a81e02efcef2f -- libcxx/include/__algorithm/out_value_result.h libcxx/include/__numeric/ranges_iota.h libcxx/test/std/algorithms/algorithms.results/out_value_result.pass.cpp libcxx/test/std/numerics/numeric.ops/numeric.iota/ranges.iota.pass.cpp libcxx/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp
``````````

</details>

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

``````````diff
diff --git a/libcxx/include/__numeric/ranges_iota.h b/libcxx/include/__numeric/ranges_iota.h
index 9e55c1d1ea89..fccb36396a05 100644
--- a/libcxx/include/__numeric/ranges_iota.h
+++ b/libcxx/include/__numeric/ranges_iota.h
@@ -44,8 +44,8 @@ private:
 public:
   // Public facing interfaces
   template <input_or_output_iterator _Out, sentinel_for<_Out> _Sent, weakly_incrementable _Tp>
-  requires indirectly_writable<_Out, const _Tp&> _LIBCPP_HIDE_FROM_ABI static constexpr iota_result<_Out, _Tp>
-  operator()(_Out __first, _Sent __last, _Tp __value) {
+    requires indirectly_writable<_Out, const _Tp&>
+  _LIBCPP_HIDE_FROM_ABI static constexpr iota_result<_Out, _Tp> operator()(_Out __first, _Sent __last, _Tp __value) {
     return __iota_impl(std::move(__first), std::move(__last), std::move(__value));
   }
 
diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.iota/ranges.iota.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.iota/ranges.iota.pass.cpp
index 7aedf7ee0584..f3cd022943ca 100644
--- a/libcxx/test/std/numerics/numeric.ops/numeric.iota/ranges.iota.pass.cpp
+++ b/libcxx/test/std/numerics/numeric.ops/numeric.iota/ranges.iota.pass.cpp
@@ -26,9 +26,8 @@ concept HasIotaIter = requires(Iter&& iter, Sent&& sent, Value&& val) {
 };
 
 template <class Range, class Value = int>
-concept HasIotaRange = requires(Range&& range, Value&& val) {
-  std::ranges::iota(std::forward<Range>(range), std::forward<Value>(val));
-};
+concept HasIotaRange =
+    requires(Range&& range, Value&& val) { std::ranges::iota(std::forward<Range>(range), std::forward<Value>(val)); };
 
 constexpr void test_constraints() {
   // Test constraints of the iterator/sentinel overload

``````````

</details>


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


More information about the llvm-commits mailing list