Zijun Zhao
0218ea4aaa
[libc++] Implement ranges::ends_with
...
Reviewed By: #libc, var-const
Differential Revision: https://reviews.llvm.org/D150831
2023-09-18 11:56:10 -07:00
zijunzhao
205175578e
[libc++] Implement ranges::starts_with
2023-05-15 18:15:38 +00:00
varconst
c2b3986e39
[libc++][ranges] Temporarily mark ranges::join_view
as experimental.
...
This is in anticipation of https://isocpp.org/files/papers/D2770R0.html ,
which is ABI-breaking for `join_view`.
Differential Revision: https://reviews.llvm.org/D142520
2023-01-30 00:36:07 -08:00
Nikolas Klauser
430b397f67
[libc++] Granularize <type_traits> includes in <iterator>
...
Reviewed By: Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D140621
2022-12-27 02:32:16 +01:00
Louis Dionne
b8cb1dc9ea
[libc++] Make <ranges> non-experimental
...
When we ship LLVM 16, <ranges> won't be considered experimental anymore.
We might as well do this sooner rather than later.
Differential Revision: https://reviews.llvm.org/D132151
2022-08-18 16:59:58 -04:00
Konstantin Varlamov
8ac015caf6
[libc++][ranges][NFC] Make sure all implemented algorithms are enabled in "robust" tests.
...
Also fix `std::find_first_of` (which accidentally copied the predicate
in the implementation).
Differential Revision: https://reviews.llvm.org/D131235
2022-08-05 14:02:12 -07:00
Nikolas Klauser
4038c859e5
[libc++][ranges] Implement ranges::is_permutation
...
Co-authored-by: Konstantin Varlamov <varconst@apple.com>
Differential Revision: https://reviews.llvm.org/D127194
2022-08-04 10:54:37 -07:00
Nikolas Klauser
a203acb9dd
[libc++][ranges] Implement ranges::clamp
...
Differential Revision: https://reviews.llvm.org/D126193
2022-08-04 02:45:32 -07:00
Konstantin Varlamov
36c746ca2d
[libc++][ranges] Implement ranges::rotate
.
...
Also fix `ranges::stable_sort` and `ranges::inplace_merge` to support
proxy iterators now that their internal implementations can correctly
dispatch `rotate`.
Differential Revision: https://reviews.llvm.org/D130758
2022-08-03 16:04:24 -07:00
Konstantin Varlamov
6bdb642234
[libc++][ranges] Implement ranges::sample
.
...
Differential Revision: https://reviews.llvm.org/D130865
2022-08-02 22:34:23 -07:00
Nikolas Klauser
93172c1c2b
[libc++][ranges] Implement ranges::replace_copy{,_if}
.
...
Co-authored-by: Konstantin Varlamov <varconst@apple.com>
Differential Revision: https://reviews.llvm.org/D129806
2022-08-02 22:32:01 -07:00
Nikolas Klauser
760d2b462c
[libc++][ranges] Implement ranges::remove_copy{, _if}
.
...
Co-authored-by: Hui Xie <hui.xie1990@gmail.com>
Differential Revision: https://reviews.llvm.org/D130599
2022-08-02 22:19:13 -07:00
Konstantin Varlamov
db7d795978
[libc++][ranges] Implement std::ranges::partial_sort_copy
.
...
Differential Revision: https://reviews.llvm.org/D130532
2022-07-30 02:42:18 -07:00
Hui Xie
72f57e3a30
[libc++][ranges] implement std::ranges::unique{_copy}
...
implement `std::ranges::unique` and `std::ranges::unique_copy`
Differential Revision: https://reviews.llvm.org/D130404
2022-07-29 08:28:17 +01:00
Hui Xie
8a61749f76
[libc++][ranges] implement std::ranges::inplace_merge
...
Differential Revision: https://reviews.llvm.org/D130627
2022-07-28 08:37:48 +01:00
Konstantin Varlamov
d406c6493e
[libc++][ranges] Implement ranges::is_heap{,_until}
.
...
Differential Revision: https://reviews.llvm.org/D130547
2022-07-26 16:11:24 -07:00
Konstantin Varlamov
ead7302bbb
[libc++][ranges] Implement ranges::generate{,_n}
.
...
Differential Revision: https://reviews.llvm.org/D130552
2022-07-26 15:50:32 -07:00
Konstantin Varlamov
14cf74d65d
[libc++][ranges] Implement ranges::shuffle
.
...
Differential Revision: https://reviews.llvm.org/D130321
2022-07-22 09:59:13 -07:00
Hui Xie
c559964d85
[libc++][ranges] implement std::ranges::includes
...
implement `std::ranges::includes` and delegate to `std::includes`
Differential Revision: https://reviews.llvm.org/D130116
2022-07-22 10:27:48 +01:00
Hui Xie
0f6364b8a1
[libc++][ranges] implement std::ranges::equal_range
...
implement `std::ranges::equal_range` which delegates to
`std::equal_range`
Differential Revision: https://reviews.llvm.org/D129796
2022-07-22 10:24:08 +01:00
Konstantin Varlamov
065202f3ca
[libc++][ranges] Implement std::ranges::partition_{point,copy}
.
...
Reviewed By: #libc, huixie90, ldionne
Differential Revision: https://reviews.llvm.org/D130070
2022-07-20 11:39:07 -07:00
varconst
5dd19ada57
[libc++][ranges] Implement ranges::partial_sort
.
...
Differential Revision: https://reviews.llvm.org/D128744
2022-07-19 20:10:34 -07:00
Konstantin Varlamov
8ed702b83f
[libc++][ranges] Implement ranges::{,stable_}partition
.
...
Differential Revision: https://reviews.llvm.org/D129624
2022-07-18 21:06:17 -07:00
Hui Xie
3151b95dad
[libc++][ranges] implement std::ranges::set_union
...
[libc++][ranges] implement `std::ranges::set_union`
Differential Revision: https://reviews.llvm.org/D129657
2022-07-14 21:05:30 +01:00
Hui Xie
a5c0638dec
[libc++][ranges] implement std::ranges::set_symmetric_difference
...
[libc++][ranges] implement `std::ranges::set_symmetric_difference`
Differential Revision: https://reviews.llvm.org/D129520
2022-07-13 21:24:32 +01:00
Nikolas Klauser
101d1e9b3c
[libc++] Implement ranges::find_end, ranges::search{, _n}
...
Reviewed By: var-const, #libc, huixie90
Spies: thakis, h-vetinari, huixie90, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D124079
2022-07-13 20:30:55 +02:00
Nikolas Klauser
1f04759316
Revert "[libc++] Implement ranges::find_end, ranges::search{, _n}"
...
This reverts commit 76a76518507ccc59ccdad5b83f44dc8c3d9593c7.
2022-07-13 13:41:25 +02:00
Nikolas Klauser
76a7651850
[libc++] Implement ranges::find_end, ranges::search{, _n}
...
Reviewed By: var-const, #libc, huixie90
Spies: h-vetinari, huixie90, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D124079
2022-07-13 13:11:26 +02:00
Konstantin Varlamov
73ebcabff2
[libc++][ranges][NFC] Implement the repetitive parts of the remaining range algorithms:
...
- create the headers (but not include them from `<algorithm>`);
- define the niebloid and its member functions with the right signatures
(as no-ops);
- make sure all the right headers are included that are required by each
algorithm's signature;
- update `CMakeLists.txt` and the module map;
- create the test files with the appropriate synopses.
The synopsis in `<algorithm>` is deliberately not updated because that
could be taken as a readiness signal. The new headers aren't included
from `<algorithm>` for the same reason.
Differential Revision: https://reviews.llvm.org/D129549
2022-07-12 02:48:31 -07:00
Nikolas Klauser
7d426a392f
[libc++] Implement ranges::{reverse, rotate}_copy
...
Reviewed By: var-const, #libc
Spies: huixie90, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D127211
2022-07-11 21:13:08 +02:00
Hui Xie
96b674f23c
[libc++][ranges] implement std::ranges::set_intersection
...
implement `std::ranges::set_intersection` by reusing the classic `std::set_intersenction`
added unit tests
Differential Revision: https://reviews.llvm.org/D129233
2022-07-11 06:55:09 +01:00
Konstantin Varlamov
c945bd0da6
[libc++][ranges] Implement modifying heap algorithms:
...
- `ranges::make_heap`;
- `ranges::push_heap`;
- `ranges::pop_heap`;
- `ranges::sort_heap`.
Differential Revision: https://reviews.llvm.org/D128115
2022-07-08 13:48:41 -07:00
Konstantin Varlamov
23c7328bad
[libc++][ranges] Implement ranges::nth_element
.
...
Differential Revision: https://reviews.llvm.org/D128149
2022-07-08 11:26:02 -07:00
Hui Xie
1cdec6c96e
[libcxx][ranges] implement std::ranges::set_difference
...
implement `std::ranges::set_difference`
reused classic std::set_difference
added unit tests
Differential Revision: https://reviews.llvm.org/D128983
2022-07-08 13:26:23 +01:00
Nikolas Klauser
f8cbe3cdf0
[libc++] Implement ranges::remove{, _if}
...
Reviewed By: var-const, #libc
Spies: huixie90, sstefan1, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D128618
2022-07-06 18:47:13 +02:00
Hui Xie
25607d143d
[libc++] Implement std::ranges::merge
...
Implement `std::ranges::merge`. added unit tests
Differential Revision: https://reviews.llvm.org/D128611
2022-07-04 13:44:31 +01:00
Konstantin Varlamov
94c7b89fe5
[libc++][ranges] Implement ranges::stable_sort
.
...
Differential Revision: https://reviews.llvm.org/D127834
2022-07-01 16:34:26 -07:00
Nikolas Klauser
2c3bbac0c7
[libc++] Implement ranges::move{, _backward}
...
This patch also adds a new optimization to `std::move`. It unwraps three `reverse_iterator`s if the wrapped iterator is a `contiguous_iterator` and the iterated type is trivially_movable. This allows us to simplify `ranges::move_backward` to a forward to `std::move` without any pessimization.
Reviewed By: var-const, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D126616
2022-06-23 13:52:49 +02:00
Konstantin Varlamov
ff3989e6ae
[libc++][ranges] Implement ranges::sort
.
...
Differential Revision: https://reviews.llvm.org/D127557
2022-06-16 15:21:06 -07:00
Nikolas Klauser
afd5a4f2dc
[libc++] Implement ranges::lexicographical_compare
...
Reviewed By: var-const, Mordante, #libc
Spies: H-G-Hristov, sstefan1, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D127130
2022-06-15 22:29:21 +02:00
Nikolas Klauser
ff6d5dee71
[libc++] Implement ranges::replace{, _if}
...
Reviewed By: var-const, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D126283
2022-06-10 11:54:46 +02:00
Nikolas Klauser
916e9052ba
[libc++] Implement ranges::adjacent_find
...
Reviewed By: Mordante, var-const, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D126610
2022-06-08 12:15:03 +02:00
Nikolas Klauser
8171586176
[libc++][ranges] Implement ranges::binary_search and ranges::{lower, upper}_bound
...
Reviewed By: Mordante, var-const, ldionne, #libc
Spies: sstefan1, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D121964
2022-06-06 13:33:18 +02:00
Nikolas Klauser
3606da5fba
[libc++] Enable ranges_robust_against* and niebloid tests for implemented ranges algorithms
...
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D126477
2022-05-27 10:40:01 +02:00
Nikolas Klauser
11e3ad299f
[libc++] Implement ranges::is_sorted{, _until}
...
Reviewed By: Mordante, var-const, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D125608
2022-05-27 10:28:44 +02:00
Nikolas Klauser
0e3dc1a52f
[libc++] Implement ranges::{all, any, none}_of
...
Reviewed By: ldionne, var-const, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D123016
2022-05-26 16:50:08 +02:00
Joe Loser
5a2dbe49be
[libc++][test] Verify std::ranges::rbegin, crbegin, rend, crend are CPOs
...
Uncomment the tests to ensure `std::ranges::rbegin` and friends are indeed
customization points objects.
Differential Revision: https://reviews.llvm.org/D126325
2022-05-25 08:48:22 -06:00
Nikolas Klauser
1d1a191edc
[libc++] Implement ranges::reverse
...
Reviewed By: var-const, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D125752
2022-05-24 10:33:57 +02:00
Joe Loser
496e135b03
[libc++][test] Verify std::views::drop and std::views::join are CPOs
...
`std::views::drops` and `std::views::join` have been implemented, but the tests
verifying the CPOs for them are still commented out. Uncomment the tests.
Differential Revision: https://reviews.llvm.org/D125618
2022-05-14 22:11:36 -06:00
Konstantin Varlamov
0102527352
[libc++][ranges] Implement views::single
.
...
This only adds the customization point object (which isn't pipeable),
the view itself has already been implemented previously.
Differential Revision: https://reviews.llvm.org/D124978
2022-05-06 14:27:08 -07:00