[clang] Implement libcxx ranges contains (PR #70258)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 25 15:01:38 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 4c60c0cb4e3e7ac45f588499da8d674619d3845a 3e16ddebac3ddc424b88fd5c8fdc296dac3fab85 -- libcxx/include/__algorithm/ranges_contains.h libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp
index 64a88e46f2c2..b606eb410dd2 100644
--- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp
@@ -153,16 +153,14 @@ constexpr void test_iterators() {
}
constexpr bool test() {
- types::for_each(
- types::type_list<char, short, int, long, long long>{},
- []<class T> {
- types::for_each(types::cpp20_input_iterator_list<T*>{}, []<class Iter> {
- if constexpr (std::forward_iterator<Iter>)
- test_iterators<Iter>();
- test_iterators<Iter, sentinel_wrapper<Iter>>();
- test_iterators<Iter, sized_sentinel<Iter>>();
- });
- });
+ types::for_each(types::type_list<char, short, int, long, long long>{}, []<class T> {
+ types::for_each(types::cpp20_input_iterator_list<T*>{}, []<class Iter> {
+ if constexpr (std::forward_iterator<Iter>)
+ test_iterators<Iter>();
+ test_iterators<Iter, sentinel_wrapper<Iter>>();
+ test_iterators<Iter, sized_sentinel<Iter>>();
+ });
+ });
{ // count invocations of the projection
int a[] = {1, 9, 0, 13, 25};
``````````
</details>
https://github.com/llvm/llvm-project/pull/70258
More information about the cfe-commits
mailing list