Skip to content

Commit 1de4654

Browse files
committed
libcxx test
1 parent 2aac2cf commit 1de4654

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

libcxx/test/libcxx/containers/container.adaptors/flat.multiset/insert.temporary.pass.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "../flat_helpers.h"
2222
#include "test_macros.h"
2323

24-
bool test() {
24+
constexpr bool test() {
2525
using M = std::flat_multiset<TrackCopyMove>;
2626
{
2727
M m;
@@ -43,6 +43,9 @@ bool test() {
4343

4444
int main(int, char**) {
4545
test();
46+
#if TEST_STD_VER >= 26
47+
static_assert(test());
48+
#endif
4649

4750
return 0;
4851
}

libcxx/test/libcxx/containers/container.adaptors/flat.multiset/insert_range.pass.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,33 @@
2424
#include <vector>
2525

2626
#include "../flat_helpers.h"
27+
#include "test_iterators.h"
2728
#include "test_macros.h"
2829

29-
void test() {
30+
constexpr bool test() {
3031
NotQuiteSequenceContainer<int> v;
3132
std::flat_multiset s(v);
32-
std::istringstream ints("0 1 1 0");
33-
auto r = std::ranges::subrange(std::istream_iterator<int>(ints), std::istream_iterator<int>()) |
34-
std::views::transform([](int i) { return i * i; });
33+
34+
int ar[] = {0, 1, 1, 0};
35+
using Iter = cpp20_input_iterator<const int*>;
36+
using Sent = sentinel_wrapper<Iter>;
37+
using R = std::ranges::subrange<Iter, Sent>;
38+
auto r = R(Iter(ar), Sent(Iter(ar + 4)));
39+
3540
static_assert(
3641
![](auto& t) { return requires { t.insert_range(t.end(), r); }; }(v),
3742
"This test is to test the case where the underlying container does not provide insert_range");
3843
s.insert_range(r);
3944
assert(std::ranges::equal(s, std::vector<int>{0, 0, 1, 1}));
45+
46+
return true;
4047
}
4148

4249
int main(int, char**) {
4350
test();
51+
#if TEST_STD_VER >= 26
52+
static_assert(test());
53+
#endif
4454

4555
return 0;
4656
}

0 commit comments

Comments
 (0)