aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/algorithm
AgeCommit message (Collapse)AuthorFilesLines
2022-06-23[libc++] Implement ranges::move{, _backward}Nikolas Klauser1-0/+23
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-17[libc++] Mark standard-mandated includes as suchNikolas Klauser1-1/+3
Reviewed By: ldionne, Mordante, #libc, saugustine Spies: saugustine, MaskRay, arichardson, mstorsjo, jloser, libcxx-commits, arphaman Differential Revision: https://reviews.llvm.org/D127953
2022-06-16[libc++][ranges] Implement `ranges::sort`.Konstantin Varlamov1-1/+12
Differential Revision: https://reviews.llvm.org/D127557
2022-06-15[libc++] Implement ranges::lexicographical_compareNikolas Klauser1-0/+17
Reviewed By: var-const, Mordante, #libc Spies: H-G-Hristov, sstefan1, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D127130
2022-06-15[libc++] Removes unneeded <iterator> includes.Mark de Wever1-1/+0
Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D127675
2022-06-10[libc++] Granularize <iterator> includesNikolas Klauser1-1/+1
Reviewed By: ldionne, #libc Spies: libcxx-commits, wenlei Differential Revision: https://reviews.llvm.org/D127445
2022-06-10[libc++] Implement ranges::replace{, _if}Nikolas Klauser1-0/+25
Reviewed By: var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D126283
2022-06-08[libc++] Implement ranges::adjacent_findNikolas Klauser1-0/+11
Reviewed By: Mordante, var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D126610
2022-06-06[libc++] Implement ranges::find_first_ofNikolas Klauser1-0/+16
Reviewed By: Mordante, var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D126529
2022-06-06[libc++][ranges] Implement ranges::binary_search and ranges::{lower, ↵Nikolas Klauser1-0/+34
upper}_bound Reviewed By: Mordante, var-const, ldionne, #libc Spies: sstefan1, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D121964
2022-05-27[libc++] Implement ranges::is_sorted{, _until}Nikolas Klauser1-0/+18
Reviewed By: Mordante, var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D125608
2022-05-26[libc++] Implement ranges::{all, any, none}_ofNikolas Klauser1-0/+27
Reviewed By: ldionne, var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D123016
2022-05-26[libc++] Implement ranges::equalNikolas Klauser1-0/+15
Reviewed By: var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D123681
2022-05-25[libc++] Implement ranges::fill{, _n}Nikolas Klauser1-0/+10
Reviewed By: var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D123462
2022-05-24[libc++] Implement ranges::reverseNikolas Klauser1-0/+10
Reviewed By: var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D125752
2022-05-23[libc++] Add ranges::max_element to the synopsis and ADL-proof the ↵Nikolas Klauser1-0/+9
__min_element_impl calls Reviewed By: ldionne, #libc Spies: sstefan1, libcxx-commits Differential Revision: https://reviews.llvm.org/D126167
2022-05-06[libc++] Implement ranges::is_partitionedNikolas Klauser1-0/+10
Reviewed By: var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D124440
2022-05-04[libc++] Implement ranges::for_each{, _n}Nikolas Klauser1-0/+20
Reviewed By: var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D124332
2022-04-26[libc++] Remove <functional> includesNikolas Klauser1-1/+0
Reviewed By: var-const, #libc, ldionne Spies: #libc_vendors, ldionne, libcxx-commits, miyuki Differential Revision: https://reviews.llvm.org/D124123
2022-04-20[libc++] Granularize <functional> includesNikolas Klauser1-1/+1
Reviewed By: Mordante, #libc Spies: libcxx-commits, miyuki Differential Revision: https://reviews.llvm.org/D123912
2022-04-15[libc++] Implement ranges::copy{, _n, _if, _backward}Nikolas Klauser1-0/+51
Reviewed By: Mordante, var-const, #libc Spies: sstefan1, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D122982
2022-04-14[libc++][ranges] Implement ranges::minmax and ranges::minmax_elementNikolas Klauser1-0/+28
Reviewed By: var-const, #libc, ldionne Spies: sstefan1, ldionne, BRevzin, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D120637
2022-04-07[libc++][ranges] Implement ranges::count{, _if}Nikolas Klauser1-0/+22
Reviewed By: var-const, Mordante, ldionne, #libc Spies: tcanens, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D121523
2022-04-05[libc++][ranges] Implement ranges::transformNikolas Klauser1-0/+36
Reviewed By: ldionne, var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D122173
2022-04-03[libc++][ranges] Implement ranges::maxNikolas Klauser1-6/+21
Reviewed By: Mordante, var-const, #libc Spies: sstefan1, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D122002
2022-03-30[libc++] Ensure that all public C++ headers include <__assert>Louis Dionne1-0/+1
This patch changes the requirement for getting the declaration of the assertion handler from including <__assert> to including any public C++ header of the library. Note that C compatibility headers are excluded because we don't implement all the C headers ourselves -- some of them are taken straight from the C library, like assert.h. It also adds a generated test to check it. Furthermore, this new generated test is designed in a way that will make it possible to replace almost all the existing test-generation scripts with this system in upcoming patches. Differential Revision: https://reviews.llvm.org/D122506
2022-03-18[libc++][ranges] Implement ranges::minNikolas Klauser1-2/+15
Reviewed By: var-const, Mordante, #libc Spies: jwakely, ldionne, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D119589
2022-03-17[libc++] Remove <utility> includesNikolas Klauser1-2/+0
Reviewed By: ldionne, Quuxplusone, #libc Spies: libcxx-commits, arphaman Differential Revision: https://reviews.llvm.org/D121054
2022-03-12[libc++][ranges] Implement ranges::find{, _if, _if_not}Nikolas Klauser1-0/+30
Reviewed By: var-const, #libc, ldionne Spies: ldionne, tcanens, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D121248
2022-03-08[libc++][ranges] Implement ranges::mismatchNikolas Klauser1-0/+13
Implement `ranges::mismatch` Reviewed By: Quuxplusone, ldionne, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D117817
2022-03-07[libc++][ranges] Implement ranges::max_elementNikolas Klauser1-0/+1
Implement ranges::max_element Reviewed By: Quuxplusone, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D117523
2022-03-05[libc++] Granularize <utility> includesNikolas Klauser1-1/+2
Reviewed By: ldionne, #libc Spies: EricWF, libcxx-commits, arphaman Differential Revision: https://reviews.llvm.org/D120466
2022-02-21[libc++][ranges] Add ranges::in_found_resultNikolas Klauser1-0/+4
Reviewed By: Quuxplusone, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D119763
2022-02-21[libc++][ranges] Add ranges::min_max_resultNikolas Klauser1-3/+7
Reviewed By: Quuxplusone, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D119751
2022-02-11[libc++][ranges] Implement ranges::min_elementNikolas Klauser1-2/+8
Implement ranges::min_element Reviewed By: Quuxplusone, Mordante, #libc Spies: miscco, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D117025
2022-02-11[libc++] Add ranges::in_fun_resultNikolas Klauser1-7/+7
Add `ranges::in_fun_result` Reviewed By: Quuxplusone, #libc, var-const Spies: CaseyCarter, var-const, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D116974
2022-02-10[libc++][ranges] Implement std::ranges::swap_ranges()Nikolas Klauser1-0/+11
Implement `std::ranges::swap_ranges()` Reviewed By: Quuxplusone, #libc, ldionne Spies: ldionne, mgorny, jloser, libcxx-commits Differential Revision: https://reviews.llvm.org/D116303
2022-02-04[libc++] Replace includes of <utility> with specific detail headersArthur O'Dwyer1-2/+2
Basically a rebase of D104980; most of that patch had already happened via gradual drive-by changes, but this finishes it up. Don't touch the inclusions from `<__functional_base>`, `<__hash_table>`, or `<__locale>`; those could be removed if we propagated the inclusions up to the includers of those files, but there are lots of those includers. `<algorithm>`, `<functional>`, and `<memory>` already include `<utility>` at the top level. `<iterator>` did not, so I've added it there. Differential Revision: https://reviews.llvm.org/D119020
2022-02-04[libc++] Normalize all our '#pragma GCC system_header', and regression-test.Arthur O'Dwyer1-1/+1
Now we'll notice if a header forgets to include this magic phrase. Differential Revision: https://reviews.llvm.org/D118800
2022-02-03[libc++][ranges] Add ranges::in_out_out_resultNikolas Klauser1-0/+4
Add `ranges::in_out_out_result` Reviewed By: Quuxplusone, Mordante, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D118634
2022-01-31[libc++][ranges] Add ranges::in_in_out_resultNikolas Klauser1-1/+5
Add `ranges::in_in_out_result` Reviewed By: Quuxplusone, Mordante, #libc Spies: CaseyCarter, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D117512
2022-01-14[libc++][ranges] Add ranges::in_in_resultNikolas Klauser1-0/+6
Add `std::ranges::in_in_result` Reviewed By: Quuxplusone, Mordante, #libc Spies: ldionne, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D116278
2022-01-10[libc++][ranges] Implement `uninitialized_copy{,_n}` and ↵Konstantin Varlamov1-0/+7
`uninitialized_move{,_n}`. Also implement `in_out_result` which is a prerequisite. Differential Revision: https://reviews.llvm.org/D116023
2022-01-10[libc++] Alphabetize header #includes. NFCI.Arthur O'Dwyer1-3/+3
The NFC part of D116809. We still want to enforce this in CI, but the mechanism for that is still to-be-determined. Differential Revision: https://reviews.llvm.org/D116809
2022-01-05[libc++][NFC] Remove duplicate header includes from <algorithm> and reorder themNikolas Klauser1-3/+1
Remove duplicate header includes from `<algorithm>` and reorder the includes Reviewed By: Quuxplusone, ldionne, Mordante, #libc, jloser Spies: jloser, libcxx-commits Differential Revision: https://reviews.llvm.org/D116507
2021-11-17[runtimes][NFC] Remove filenames at the top of the license noticeLouis Dionne1-1/+1
We've stopped doing it in libc++ for a while now because these names would end up rotting as we move things around and copy/paste stuff. This cleans up all the existing files so as to stop the spreading as people copy-paste headers around.
2021-08-27[libc++][NFC] Remove useless _LIBCPP_PUSH_MACROSLouis Dionne1-5/+0
Only files that actually use min/max are required to do this dance. Differential Revision: https://reviews.llvm.org/D108778
2021-06-24[libcxx][modularisation] moves <utility> content out of <type_traits>Christopher Di Bella1-0/+2
Moves: * `std::move`, `std::forward`, `std::declval`, and `std::swap` into `__utility/${FUNCTION_NAME}`. * `std::swap_ranges` and `std::iter_swap` into `__algorithm/${FUNCTION_NAME}` Differential Revision: https://reviews.llvm.org/D103734
2021-06-19[libcxx] Move all algorithms into their own headersLouis Dionne1-5187/+94
This is a fairly mechanical change, it just moves each algorithm into its own header. This is intended to be a NFC. This commit re-applies 7ed7d4ccb899, which was reverted in 692d7166f771 because the Modules build got broken. The modules build has now been fixed, so we're re-committing this. Differential Revision: https://reviews.llvm.org/D103583 Attribution note ---------------- I'm only committing this. This commit is a mix of D103583, D103330 and D104171 authored by: Co-authored-by: Christopher Di Bella <cjdb@google.com> Co-authored-by: zoecarver <z.zoelec2@gmail.com>
2021-06-07Revert "[libcxx][gardening] Move all algorithms into their own headers."Petr Hosek1-76/+5187
This reverts commit 7ed7d4ccb8991e2b5b95334b508f8cec2faee737 as it uncovered a Clang bug PR50592.