[libcxx-commits] [libcxx] [libc++][C++23] P2440R1: Implement ranges::iota (PR #109552)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Sep 21 14:55:36 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 c28e268c32a6840d08e3a4dbc9eeb8a0f564d6c0 40a283071edad4fcfbe1f7d80accf6c48f76061a --extensions ,cpp,h -- libcxx/include/__algorithm/out_value_result.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/include/__numeric/iota.h libcxx/include/algorithm libcxx/include/numeric libcxx/include/version libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.compile.pass.cpp libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
``````````

</details>

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

``````````diff
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 9058541824..d2fadd0b1e 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -2024,11 +2024,11 @@ template <class BidirectionalIterator, class Compare>
 
 #if _LIBCPP_STD_VER >= 23
 #  include <__algorithm/fold.h>
+#  include <__algorithm/out_value_result.h>
 #  include <__algorithm/ranges_contains_subrange.h>
 #  include <__algorithm/ranges_ends_with.h>
 #  include <__algorithm/ranges_find_last.h>
 #  include <__algorithm/ranges_starts_with.h>
-#  include <__algorithm/out_value_result.h>
 #endif // _LIBCPP_STD_VER >= 23
 
 #include <version>
diff --git a/libcxx/test/std/algorithms/algorithms.results/out_value_result.pass.cpp b/libcxx/test/std/algorithms/algorithms.results/out_value_result.pass.cpp
index fa04acf4be..b7b813a0a3 100644
--- a/libcxx/test/std/algorithms/algorithms.results/out_value_result.pass.cpp
+++ b/libcxx/test/std/algorithms/algorithms.results/out_value_result.pass.cpp
@@ -30,8 +30,10 @@ struct B {
 // implicit conversion
 static_assert(std::is_constructible_v<std::ranges::out_value_result<B, B>, std::ranges::out_value_result<int, int>>);
 static_assert(std::is_constructible_v<std::ranges::out_value_result<B, B>, std::ranges::out_value_result<int, int>&>);
-static_assert(std::is_constructible_v<std::ranges::out_value_result<B, B>, const std::ranges::out_value_result<int, int>>);
-static_assert(std::is_constructible_v<std::ranges::out_value_result<B, B>, const std::ranges::out_value_result<int, int>&>);
+static_assert(
+    std::is_constructible_v<std::ranges::out_value_result<B, B>, const std::ranges::out_value_result<int, int>>);
+static_assert(
+    std::is_constructible_v<std::ranges::out_value_result<B, B>, const std::ranges::out_value_result<int, int>&>);
 
 struct C {
   C(int&);
@@ -39,10 +41,14 @@ struct C {
 static_assert(!std::is_constructible_v<std::ranges::out_value_result<C, C>, std::ranges::out_value_result<int, int>&>);
 
 // has to be convertible via const&
-static_assert(std::is_convertible_v<std::ranges::out_value_result<int, int>&, std::ranges::out_value_result<long, long>>);
-static_assert(std::is_convertible_v<const std::ranges::out_value_result<int, int>&, std::ranges::out_value_result<long, long>>);
-static_assert(std::is_convertible_v<std::ranges::out_value_result<int, int>&&, std::ranges::out_value_result<long, long>>);
-static_assert(std::is_convertible_v<const std::ranges::out_value_result<int, int>&&, std::ranges::out_value_result<long, long>>);
+static_assert(
+    std::is_convertible_v<std::ranges::out_value_result<int, int>&, std::ranges::out_value_result<long, long>>);
+static_assert(
+    std::is_convertible_v<const std::ranges::out_value_result<int, int>&, std::ranges::out_value_result<long, long>>);
+static_assert(
+    std::is_convertible_v<std::ranges::out_value_result<int, int>&&, std::ranges::out_value_result<long, long>>);
+static_assert(
+    std::is_convertible_v<const std::ranges::out_value_result<int, int>&&, std::ranges::out_value_result<long, long>>);
 
 // should be move constructible
 static_assert(std::is_move_constructible_v<std::ranges::out_value_result<MoveOnly, int>>);
@@ -54,8 +60,10 @@ static_assert(!std::is_copy_constructible_v<std::ranges::out_value_result<int, M
 
 struct NotConvertible {};
 // conversions should not work if there is no conversion
-static_assert(!std::is_convertible_v<std::ranges::out_value_result<NotConvertible, int>, std::ranges::out_value_result<int, int>>);
-static_assert(!std::is_convertible_v<std::ranges::out_value_result<int, NotConvertible>, std::ranges::out_value_result<int, int>>);
+static_assert(!std::is_convertible_v<std::ranges::out_value_result<NotConvertible, int>,
+                                     std::ranges::out_value_result<int, int>>);
+static_assert(!std::is_convertible_v<std::ranges::out_value_result<int, NotConvertible>,
+                                     std::ranges::out_value_result<int, int>>);
 
 template <class T>
 struct ConvertibleFrom {

``````````

</details>


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


More information about the libcxx-commits mailing list