Mark de Wever
f7c0df002a
[libc++][format] Improve format buffer.
...
Allow bulk output operations on the buffer instead of adding one
code unit at a time. This has a huge performance benefit at the cost of
larger binary. This doesn't implement @vitaut's earlier suggestion to
avoid buffering for std::string when writing a strings. That can be done
in a follow-up patch.
There are some minor complications for the non-buffered format_to_n.
When writing one character at a time it's easy to detect when reaching
the limit n. This is solved by adding a small overhead for format_to_n.
When the next write would overflow it stores the data in the internal
buffer and copies that up-to n code units. The overhead isn't measured,
but it's expected to only be an issue for small values of n; for larger
values the general improvements will outweight the new overhead.
```
text data bss dec hex filename
349081 6096 440 355617 56d21 format.libcxx.out-baseline
344442 6088 440 350970 55afa formatted_size.libcxx.out-baseline
4567980 57272 424 4625676 46950c formatter_float.libcxx.out-baseline
718800 12472 488 731760 b2a70 formatter_int.libcxx.out-baseline
376341 6096 552 382989 5d80d format_to.libcxx.out-beaseline
370169 6096 440 376705 5bf81 format.libcxx.out
365530 6088 440 372058 5ad5a formatted_size.libcxx.out
4575116 57272 424 4632812 46b0ec formatter_float.libcxx.out
725936 12472 488 738896 b4650 formatter_int.libcxx.out
397429 6096 552 404077 62a6d format_to.libcxx.out
```
For very small strings the new method is slower, from 4 characters
there's already a small gain.
```
Comparing ./format.libcxx.out-baseline to ./format.libcxx.out
Benchmark Time CPU Time Old Time New CPU Old CPU New
--------------------------------------------------------------------------------------------------------------------------------
BM_format_string<char>/1 +0.0268 +0.0268 43 44 43 44
BM_format_string<char>/2 +0.0133 +0.0133 22 22 22 22
BM_format_string<char>/4 -0.0248 -0.0248 12 11 12 11
BM_format_string<char>/8 -0.0831 -0.0831 6 6 6 6
BM_format_string<char>/16 -0.2976 -0.2976 4 3 4 3
BM_format_string<char>/32 -0.4369 -0.4369 3 2 3 2
BM_format_string<char>/64 -0.6375 -0.6375 3 1 3 1
BM_format_string<char>/128 -0.7685 -0.7685 2 1 2 1
```
The int benchmark has benefits for the simple formatting, but shines for
the complex formatting:
```
Comparing ./formatter_int.libcxx.out-baseline to ./formatter_int.libcxx.out
Benchmark Time CPU Time Old Time New CPU Old CPU New
----------------------------------------------------------------------------------------------------------------------------------------------------
BM_Basic<uint32_t> -0.2307 -0.2307 60 46 60 46
BM_Basic<int32_t> -0.1985 -0.1985 61 49 61 49
BM_Basic<uint64_t> -0.3478 -0.3479 81 53 81 53
BM_Basic<int64_t> -0.3475 -0.3475 81 53 81 53
BM_BasicLow<__uint128_t> -0.3388 -0.3388 86 57 86 57
BM_BasicLow<__int128_t> -0.3431 -0.3431 86 57 86 57
BM_Basic<__uint128_t> -0.2822 -0.2822 236 170 236 170
BM_Basic<__int128_t> -0.3107 -0.3107 219 151 219 151
Integral_LocFalse_BaseBin_AlignNone_Int64 -0.5781 -0.5781 178 75 178 75
Integral_LocFalse_BaseBin_AlignmentLeft_Int64 -0.9231 -0.9231 1156 89 1156 89
Integral_LocFalse_BaseBin_AlignmentCenter_Int64 -0.9179 -0.9179 1107 91 1107 91
Integral_LocFalse_BaseBin_AlignmentRight_Int64 -0.9238 -0.9238 1147 87 1147 87
Integral_LocFalse_BaseBin_ZeroPadding_Int64 -0.9170 -0.9170 1137 94 1137 94
Integral_LocFalse_BaseBin_AlignNone_Uint64 -0.5923 -0.5923 175 71 175 71
Integral_LocFalse_BaseBin_AlignmentLeft_Uint64 -0.9251 -0.9251 1154 86 1154 86
Integral_LocFalse_BaseBin_AlignmentCenter_Uint64 -0.9204 -0.9204 1105 88 1105 88
Integral_LocFalse_BaseBin_AlignmentRight_Uint64 -0.9242 -0.9242 1125 85 1125 85
Integral_LocFalse_BaseBin_ZeroPadding_Uint64 -0.9232 -0.9232 1139 88 1139 88
Integral_LocFalse_BaseOct_AlignNone_Int64 -0.3241 -0.3241 100 67 100 67
Integral_LocFalse_BaseOct_AlignmentLeft_Int64 -0.9322 -0.9322 1166 79 1166 79
Integral_LocFalse_BaseOct_AlignmentCenter_Int64 -0.9251 -0.9251 1108 83 1108 83
Integral_LocFalse_BaseOct_AlignmentRight_Int64 -0.9303 -0.9303 1136 79 1136 79
Integral_LocFalse_BaseOct_ZeroPadding_Int64 -0.9264 -0.9264 1156 85 1156 85
Integral_LocFalse_BaseOct_AlignNone_Uint64 -0.3116 -0.3116 96 66 96 66
Integral_LocFalse_BaseOct_AlignmentLeft_Uint64 -0.9310 -0.9310 1168 81 1168 81
Integral_LocFalse_BaseOct_AlignmentCenter_Uint64 -0.9281 -0.9281 1128 81 1128 81
Integral_LocFalse_BaseOct_AlignmentRight_Uint64 -0.9299 -0.9299 1148 80 1148 80
Integral_LocFalse_BaseOct_ZeroPadding_Uint64 -0.9288 -0.9288 1153 82 1153 82
Integral_LocFalse_BaseDec_AlignNone_Int64 -0.3342 -0.3342 95 63 95 63
Integral_LocFalse_BaseDec_AlignmentLeft_Int64 -0.9360 -0.9360 1157 74 1157 74
Integral_LocFalse_BaseDec_AlignmentCenter_Int64 -0.9303 -0.9303 1128 79 1128 79
Integral_LocFalse_BaseDec_AlignmentRight_Int64 -0.9369 -0.9369 1164 73 1164 73
Integral_LocFalse_BaseDec_ZeroPadding_Int64 -0.9323 -0.9323 1157 78 1157 78
Integral_LocFalse_BaseDec_AlignNone_Uint64 -0.3198 -0.3198 93 63 93 63
Integral_LocFalse_BaseDec_AlignmentLeft_Uint64 -0.9351 -0.9351 1158 75 1158 75
Integral_LocFalse_BaseDec_AlignmentCenter_Uint64 -0.9298 -0.9298 1128 79 1128 79
Integral_LocFalse_BaseDec_AlignmentRight_Uint64 -0.9361 -0.9361 1157 74 1157 74
Integral_LocFalse_BaseDec_ZeroPadding_Uint64 -0.9333 -0.9333 1151 77 1151 77
Integral_LocFalse_BaseHex_AlignNone_Int64 -0.3020 -0.3020 89 62 89 62
Integral_LocFalse_BaseHex_AlignmentLeft_Int64 -0.9357 -0.9357 1174 75 1174 75
Integral_LocFalse_BaseHex_AlignmentCenter_Int64 -0.9319 -0.9319 1129 77 1129 77
Integral_LocFalse_BaseHex_AlignmentRight_Int64 -0.9350 -0.9350 1161 75 1161 75
Integral_LocFalse_BaseHex_ZeroPadding_Int64 -0.9293 -0.9293 1150 81 1150 81
Integral_LocFalse_BaseHex_AlignNone_Uint64 -0.3056 -0.3057 86 59 86 59
Integral_LocFalse_BaseHex_AlignmentLeft_Uint64 -0.9378 -0.9378 1174 73 1174 73
Integral_LocFalse_BaseHex_AlignmentCenter_Uint64 -0.9341 -0.9341 1129 74 1130 74
Integral_LocFalse_BaseHex_AlignmentRight_Uint64 -0.9361 -0.9361 1157 74 1157 74
Integral_LocFalse_BaseHex_ZeroPadding_Uint64 -0.9315 -0.9315 1147 79 1147 79
Integral_LocFalse_BaseHexUpper_AlignNone_Int64 -0.0019 -0.0019 91 90 91 90
Integral_LocFalse_BaseHexUpper_AlignmentLeft_Int64 -0.9099 -0.9099 1162 105 1162 105
Integral_LocFalse_BaseHexUpper_AlignmentCenter_Int64 -0.9041 -0.9041 1121 108 1121 108
Integral_LocFalse_BaseHexUpper_AlignmentRight_Int64 -0.9086 -0.9086 1162 106 1162 106
Integral_LocFalse_BaseHexUpper_ZeroPadding_Int64 -0.9057 -0.9057 1164 110 1164 110
Integral_LocFalse_BaseHexUpper_AlignNone_Uint64 +0.0110 +0.0110 86 87 86 87
Integral_LocFalse_BaseHexUpper_AlignmentLeft_Uint64 -0.9136 -0.9136 1161 100 1161 100
Integral_LocFalse_BaseHexUpper_AlignmentCenter_Uint64 -0.9078 -0.9078 1133 104 1133 104
Integral_LocFalse_BaseHexUpper_AlignmentRight_Uint64 -0.9132 -0.9132 1177 102 1177 102
Integral_LocFalse_BaseHexUpper_ZeroPadding_Uint64 -0.9091 -0.9091 1160 105 1160 105
```
Other benchmarks give similar results.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D129964
2022-08-16 18:54:10 +02:00
Adrian Vogelsgesang
877620bd96
[libc++] Implement `operator<=>` for `error_{code,condition}`
...
Implements part of P1614R2 "The Mothership has Landed"
Differential Revision: https://reviews.llvm.org/D131371
2022-08-15 16:05:53 -07:00
Adrian Vogelsgesang
0e876eda26
[libc++] Implement `operator<=>` for `error_category`
...
Implements part of P1614R2 "The Mothership has Landed"
Differential Revision: https://reviews.llvm.org/D131363
2022-08-15 16:05:08 -07:00
Kent Ross
c4566cac49
[libc++][spaceship] Implement std::variant::operator<=>
...
Implements [variant.relops] and [variant.monostate.relops] for P1614R2
Reviewed By: Mordante, #libc, avogelsgesang
Differential Revision: https://reviews.llvm.org/D131372
2022-08-14 16:16:52 -07:00
Igor Zhukov
0c90d5f7e9
[libc++][test] fix C4267 warning in bitset.members\to_ulong.pass.cpp
...
Reviewed By: philnik
Differential Revision: https://reviews.llvm.org/D131854
2022-08-14 22:24:58 +07:00
Mark de Wever
22b5adff71
[libc++] Uses operator<=> in string.
...
Implements part of:
- P1614R2 The Mothership has Landed
Reviewed By: avogelsgesang, #libc, philnik
Differential Revision: https://reviews.llvm.org/D131421
2022-08-14 14:05:05 +02:00
Nikolas Klauser
f02120fba2
[libc++] Implement P2417R2 (A more constexpr bitset)
...
Reviewed By: ldionne, #libc
Spies: jloser, arichardson, libcxx-commits, arphaman
Differential Revision: https://reviews.llvm.org/D131218
2022-08-14 10:34:01 +02:00
Nikolas Klauser
7ae66e5e95
[libc++] Granularize the rest of type_traits
...
Reviewed By: ldionne, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D130471
2022-08-14 10:30:48 +02:00
Adrian Vogelsgesang
41e7665c4b
[libc++] Implement `operator<=>` for `thread::id`
...
The new operator<=> is mapped onto the existing functions
__libcpp_thread_id_equal and __libcpp_thread_id_less. Introducing a
new __libcpp_thread_id_compare_three_way might lead to more efficient
code. Given that we can still introduce __libcpp_thread_id_compare_three_way
later, for this commit I opted to not break ABI. If requested, I will
add __libcpp_thread_id_compare_three_way in a follow-up commit.
Implements part of P1614R2 "The Mothership has Landed"
Differential Revision: https://reviews.llvm.org/D131362
2022-08-13 17:30:55 -07:00
Adrian Vogelsgesang
2d34cb74b5
[libc++] Implement `thread::id` comparators as free functions
...
So far, the `thread::id` comparators were implemented as hidden friends.
This was non-conforming and lead to incorrectly rejected C++ code, as
can be seen in the linked Github issue.
Fixes https://github.com/llvm/llvm-project/issues/56187
Differential Revision: https://reviews.llvm.org/D131430
2022-08-10 11:39:50 -07:00
Mark de Wever
70074cf397
[libc++] Fixes string_view comparison operators.
...
While implementing `operator<=>` for `string_view` (D130295) @philnik
pointed out `common_type` should be `type_identity`. Since it was an
existing issue that wasn't addressed.
This addresses the issue for both the new and existing equality and
comparison operators. The test is based on the example posted in
D130295.
Reviewed By: philnik, #libc, huixie90
Differential Revision: https://reviews.llvm.org/D131322
2022-08-10 19:38:50 +02:00
Adrian Vogelsgesang
9df5892804
[libc++] Implement `operator<=>` for `type_index`
...
Implements part of P1614R2 "The Mothership has Landed"
Differential Revision: https://reviews.llvm.org/D131357
2022-08-09 16:35:17 -07:00
Adrian Vogelsgesang
cfefee87c2
[libc++][NFC] Remove TEST_HAS_NO_SPACESHIP_OPERATOR
...
The corresponding _LIBCPP_HAS_NO_SPACESHIP_OPERATOR macro was already
removed in commit c0f87e8382
Differential Revision: https://reviews.llvm.org/D131215
2022-08-09 16:32:54 -07:00
Mark de Wever
195287d90a
[libc++][ranges] Sets ranges feature-test macro.
...
D131234 marked the ranges papers as complete, but it didn't set the
feature-test macro.
Reviewed By: ldionne, var-const, #libc
Differential Revision: https://reviews.llvm.org/D131326
2022-08-09 17:20:36 +02:00
Adrian Vogelsgesang
706b3951b3
[libc++] Implement `operator==` for `filesystem::space_info`
...
Implements part of P1614R2 "The Mothership has Landed"
Differential Revision: https://reviews.llvm.org/D130861
2022-08-08 10:05:47 -07:00
Igor Zhukov
6bb51bf062
[libc++][test] Fix MSVC warnings C6054, C6001, C4242 in format_tests.h
...
Reviewed By: Mordante
Differential Revision: https://reviews.llvm.org/D131336
2022-08-07 16:55:50 +07:00
Adrian Vogelsgesang
735240b38f
[libc++] Implement `operator<=>` for `unique_ptr`
...
Implements part of:
- P1614R2 The Mothership has Landed
Fixes LWG3426
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D130838
2022-08-06 15:09:16 +02: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
Konstantin Varlamov
52d4c5016c
[libc++] Fix a hard error in `contiguous_iterator<NoOperatorArrowIter>`.
...
Evaluating `contiguous_iterator` on an iterator that satisfies all the
constraints except the `to_address` constraint and doesn't have
`operator->` defined results in a hard error. This is because
instantiating `to_address` ends up instantiating templates
dependent on the given type which might lead to a hard error even
in a SFINAE context.
Differential Revision: https://reviews.llvm.org/D130835
2022-08-04 10:58:21 -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
Mark de Wever
3818b4df1e
[libc++] Uses operator<=> in string_view
...
Implements:
- LWG3432 Missing requirement for comparison_category
Implements part of:
- P1614R2 The Mothership has Landed
Reviewed By: #libc, ldionne, jloser, philnik
Differential Revision: https://reviews.llvm.org/D130295
2022-08-04 19:13:47 +02: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
Adrian Vogelsgesang
3b217f2f12
[libc++] Implement `operator<=>` for `shared_ptr`
...
Implements part of:
* P1614R2 The Mothership has Landed
Fixes LWG3427
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D130852
2022-08-03 18:32:45 +02:00
Casey Carter
3a45677467
[libcxx][test] Silence narrowing warning
2022-08-03 09:10:47 -07:00
Nikolas Klauser
68264b6494
[libc++][ranges] Implement `ranges::{prev, next}_permutation`.
...
Co-authored-by: Konstantin Varlamov <varconst@apple.com>
Differential Revision: https://reviews.llvm.org/D129859
2022-08-02 22:46:15 -07:00
cpplearner
8a78b72289
[libc++][test] Replace `_LIBCPP_STD_VER` with `TEST_STD_VER`
...
Differential Revision: https://reviews.llvm.org/D130979
2022-08-03 13:54:04 +08: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
Konstantin Varlamov
f537a01d39
[libc++][ranges] Fix the return value of `{copy,move}_backward`.
...
The return value for both of these algorithms is specified as
```
`{last, result - N}` for the overloads in namespace `ranges`.
```
But the current implementation instead returns `{first, result - N}`.
Also add both algorithms to the relevant "robust" tests.
Differential Revision: https://reviews.llvm.org/D130968
2022-08-02 22:22:59 -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
Igor Zhukov
495519e5f8
[libc++][NFC] Don't rely on `<algorithm>` transitively including `<memory>` in tests
...
Found by @cpplearner (https://github.com/microsoft/STL/pull/2976#discussion_r935440806 )
Differential Revision: https://reviews.llvm.org/D130997
2022-08-02 20:46:05 -04:00
Igor Zhukov
db0ac307c9
[libc++] Fix warning C4244 in std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp
...
frederick-vs-ja noticed that https://github.com/microsoft/STL/pull/2976#issuecomment-1201926893
while we are working on updating LLVM submodule for MS STL:
[...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): error C2220: the following warning is treated as an error
[...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(287): note: see reference to function template instantiation 'void tests<__int64>(void)' being compiled
[...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data
Differential Revision: https://reviews.llvm.org/D130963
2022-08-02 20:44:46 -04:00
Mark de Wever
f712775daf
[libc++][format] Exposes basic-format-string
...
This paper was accepted during the last plenary and is intended to be
backported to LLVM 15. When backporting the release notes in the branch
should be updated too.
Note the feature-test macro isn't updated since this will change; three
papers have updated the same macro in the same plenary.
Implements:
- P2508R1 Exposing std::basic-format-string
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D130643
2022-08-02 20:33:17 +02:00
Mark de Wever
679169b7dd
[libc++][format] Enables feature-test macro.
...
The macro is only enabled when the Clang is used with
-fexperimental-library.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D130792
2022-08-02 18:43:27 +02:00
Igor Zhukov
8be1197285
[libc++] Implement P2499R0 (`string_view` range constructor should be `explicit`)
...
Reviewed By: #libc, philnik, Mordante
Spies: Mordante, jloser, philnik, libcxx-commits
Differential Revision: https://reviews.llvm.org/D130785
2022-08-02 12:47:45 +02:00
Gabriel Ravier
c23e2c015f
[libcxx] Fixed a number of typos
...
I went over the output of the following mess of a command:
`(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)`
and proceeded to spend a few days looking at it to find probable typos
and fixed a few hundred of them in all of the llvm project (note, the
ones I found are not anywhere near all of them, but it seems like a
good start).
Reviewed By: #libc, philnik
Spies: philnik, libcxx-commits, mgorny, arichardson
Differential Revision: https://reviews.llvm.org/D130905
2022-08-02 12:42:34 +02: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
Nikolas Klauser
7912b1f8e7
[libc++] Fix reverse_iterator::iterator_concept
...
Fixes https://github.com/llvm/llvm-project/issues/56504
Reviewed By: ldionne, Mordante, huixie90, #libc
Spies: libcxx-commits, hewillk
Differential Revision: https://reviews.llvm.org/D129794
2022-07-30 10:53:59 +02: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
Nikolas Klauser
e01b4fe956
[libc++] Fix unwrapping ranges with different iterators and sentinels
...
Reviewed By: ldionne, huixie90, #libc
Spies: arichardson, sstefan1, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D129040
2022-07-28 10:22:41 +02: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
Mark de Wever
41f7bb9975
[libc++][chrono] Uses operator<=> in the calendar.
...
Since the calendar is added in C++20 the existing operators are removed.
Implements part of:
- P1614R2 The Mothership has Landed
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D129887
2022-07-27 21:53:08 +02:00
Nikolas Klauser
98d3d5b5da
[libc++] Implement P1004R2 (constexpr std::vector)
...
Reviewed By: #libc, ldionne
Spies: mgorny, var-const, ormris, philnik, miscco, hiraditya, steven_wu, jkorous, ldionne, christof, libcxx-commits
Differential Revision: https://reviews.llvm.org/D68365
2022-07-27 20:26:44 +02:00
Konstantin Varlamov
b105f26c8a
[libc++][ranges] Fix the CI.
2022-07-26 19:45:06 -07:00
Konstantin Varlamov
8e26c315a7
[libc++][NFC] Add checks for lifetime issues in classic algorithms.
...
Differential Revision: https://reviews.llvm.org/D130330
2022-07-26 16:15:11 -07: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
964aeb713e
[libc++][ranges] Make sure all range algorithms support differing projection types:
...
- for all algorithms taking more than one range, add a `robust` test to
check the case where the ranges have different value types and the
given projections are different, with each projection applying to
a different value type;
- fix `ranges::include` to apply the correct projection to each range.
Differential Revision: https://reviews.llvm.org/D130515
2022-07-26 15:51:49 -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
Nikolas Klauser
f4fb72e6d4
[libc++] Use uninitialized algorithms for vector
...
Reviewed By: ldionne, #libc
Spies: huixie90, eaeltsin, joanahalili, bgraur, alexfh, hans, avogelsgesang, augusto2112, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D128146
2022-07-26 17:44:31 +02:00