File tree Expand file tree Collapse file tree 12 files changed +132
-36
lines changed
libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.operations Expand file tree Collapse file tree 12 files changed +132
-36
lines changed Original file line number Diff line number Diff line change 23
23
#include " min_allocator.h"
24
24
25
25
template <class KeyContainer >
26
- void test_one () {
26
+ constexpr void test_one () {
27
27
using Key = typename KeyContainer::value_type;
28
28
{
29
29
using M = std::flat_multiset<Key, std::less<>, KeyContainer>;
@@ -66,15 +66,23 @@ void test_one() {
66
66
}
67
67
}
68
68
69
- void test () {
69
+ constexpr bool test () {
70
70
test_one<std::vector<int >>();
71
- test_one<std::deque<int >>();
71
+ #ifndef __cpp_lib_constexpr_deque
72
+ if (!TEST_IS_CONSTANT_EVALUATED)
73
+ #endif
74
+ test_one<std::deque<int >>();
72
75
test_one<MinSequenceContainer<int >>();
73
76
test_one<std::vector<int , min_allocator<int >>>();
77
+
78
+ return true ;
74
79
}
75
80
76
81
int main (int , char **) {
77
82
test ();
83
+ #if TEST_STD_VER >= 26
84
+ static_assert (test ());
85
+ #endif
78
86
79
87
return 0 ;
80
88
}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ static_assert(!CanContains<NonTransparentSet>);
35
35
static_assert (!CanContains<const NonTransparentSet>);
36
36
37
37
template <class KeyContainer >
38
- void test_one () {
38
+ constexpr void test_one () {
39
39
using Key = typename KeyContainer::value_type;
40
40
using M = std::flat_multiset<Key, TransparentComparator, KeyContainer>;
41
41
@@ -60,9 +60,12 @@ void test_one() {
60
60
}
61
61
}
62
62
63
- void test () {
63
+ constexpr bool test () {
64
64
test_one<std::vector<std::string>>();
65
- test_one<std::deque<std::string>>();
65
+ #ifndef __cpp_lib_constexpr_deque
66
+ if (!TEST_IS_CONSTANT_EVALUATED)
67
+ #endif
68
+ test_one<std::deque<std::string>>();
66
69
test_one<MinSequenceContainer<std::string>>();
67
70
test_one<std::vector<std::string, min_allocator<std::string>>>();
68
71
@@ -82,10 +85,15 @@ void test() {
82
85
assert (m.contains (" beta" ));
83
86
assert (!m.contains (" charlie" ));
84
87
}
88
+
89
+ return true ;
85
90
}
86
91
87
92
int main (int , char **) {
88
93
test ();
94
+ #if TEST_STD_VER >= 26
95
+ static_assert (test ());
96
+ #endif
89
97
90
98
return 0 ;
91
99
}
Original file line number Diff line number Diff line change 23
23
#include " min_allocator.h"
24
24
25
25
template <class KeyContainer >
26
- void test_one () {
26
+ constexpr void test_one () {
27
27
using Key = typename KeyContainer::value_type;
28
28
using S = typename KeyContainer::size_type;
29
29
@@ -66,15 +66,23 @@ void test_one() {
66
66
}
67
67
}
68
68
69
- void test () {
69
+ constexpr bool test () {
70
70
test_one<std::vector<int >>();
71
- test_one<std::deque<int >>();
71
+ #ifndef __cpp_lib_constexpr_deque
72
+ if (!TEST_IS_CONSTANT_EVALUATED)
73
+ #endif
74
+ test_one<std::deque<int >>();
72
75
test_one<MinSequenceContainer<int >>();
73
76
test_one<std::vector<int , min_allocator<int >>>();
77
+
78
+ return true ;
74
79
}
75
80
76
81
int main (int , char **) {
77
82
test ();
83
+ #if TEST_STD_VER >= 26
84
+ static_assert (test ());
85
+ #endif
78
86
79
87
return 0 ;
80
88
}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ static_assert(!CanCount<NonTransparentSet>);
35
35
static_assert (!CanCount<const NonTransparentSet>);
36
36
37
37
template <class KeyContainer >
38
- void test_one () {
38
+ constexpr void test_one () {
39
39
using Key = typename KeyContainer::value_type;
40
40
using M = std::flat_multiset<Key, TransparentComparator, KeyContainer>;
41
41
{
@@ -59,9 +59,12 @@ void test_one() {
59
59
}
60
60
}
61
61
62
- void test () {
62
+ constexpr bool test () {
63
63
test_one<std::vector<std::string>>();
64
- test_one<std::deque<std::string>>();
64
+ #ifndef __cpp_lib_constexpr_deque
65
+ if (!TEST_IS_CONSTANT_EVALUATED)
66
+ #endif
67
+ test_one<std::deque<std::string>>();
65
68
test_one<MinSequenceContainer<std::string>>();
66
69
test_one<std::vector<std::string, min_allocator<std::string>>>();
67
70
@@ -81,10 +84,15 @@ void test() {
81
84
auto n = m.count (" beta" );
82
85
assert (n == 2 );
83
86
}
87
+
88
+ return true ;
84
89
}
85
90
86
91
int main (int , char **) {
87
92
test ();
93
+ #if TEST_STD_VER >= 26
94
+ static_assert (test ());
95
+ #endif
88
96
89
97
return 0 ;
90
98
}
Original file line number Diff line number Diff line change 24
24
#include " min_allocator.h"
25
25
26
26
template <class KeyContainer >
27
- void test_one () {
27
+ constexpr void test_one () {
28
28
using Key = typename KeyContainer::value_type;
29
29
{
30
30
using M = std::flat_multiset<Key, std::less<>, KeyContainer>;
@@ -74,15 +74,23 @@ void test_one() {
74
74
}
75
75
}
76
76
77
- void test () {
77
+ constexpr bool test () {
78
78
test_one<std::vector<int >>();
79
- test_one<std::deque<int >>();
79
+ #ifndef __cpp_lib_constexpr_deque
80
+ if (!TEST_IS_CONSTANT_EVALUATED)
81
+ #endif
82
+ test_one<std::deque<int >>();
80
83
test_one<MinSequenceContainer<int >>();
81
84
test_one<std::vector<int , min_allocator<int >>>();
85
+
86
+ return true ;
82
87
}
83
88
84
89
int main (int , char **) {
85
90
test ();
91
+ #if TEST_STD_VER >= 26
92
+ static_assert (test ());
93
+ #endif
86
94
87
95
return 0 ;
88
96
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ static_assert(!CanEqualRange<NonTransparentSet>);
36
36
static_assert (!CanEqualRange<const NonTransparentSet>);
37
37
38
38
template <class KeyContainer >
39
- void test_one () {
39
+ constexpr void test_one () {
40
40
using Key = typename KeyContainer::value_type;
41
41
using M = std::flat_multiset<Key, TransparentComparator, KeyContainer>;
42
42
@@ -90,9 +90,12 @@ void test_one() {
90
90
}
91
91
}
92
92
93
- void test () {
93
+ constexpr bool test () {
94
94
test_one<std::vector<std::string>>();
95
- test_one<std::deque<std::string>>();
95
+ #ifndef __cpp_lib_constexpr_deque
96
+ if (!TEST_IS_CONSTANT_EVALUATED)
97
+ #endif
98
+ test_one<std::deque<std::string>>();
96
99
test_one<MinSequenceContainer<std::string>>();
97
100
test_one<std::vector<std::string, min_allocator<std::string>>>();
98
101
@@ -113,10 +116,15 @@ void test() {
113
116
assert (first == m.begin () + 1 );
114
117
assert (last == m.begin () + 3 );
115
118
}
119
+
120
+ return true ;
116
121
}
117
122
118
123
int main (int , char **) {
119
124
test ();
125
+ #if TEST_STD_VER >= 26
126
+ static_assert (test ());
127
+ #endif
120
128
121
129
return 0 ;
122
130
}
Original file line number Diff line number Diff line change 25
25
#include " min_allocator.h"
26
26
27
27
template <class KeyContainer >
28
- void test_one () {
28
+ constexpr void test_one () {
29
29
using Key = typename KeyContainer::value_type;
30
30
using M = std::flat_multiset<Key, std::less<>, KeyContainer>;
31
31
{
@@ -50,15 +50,23 @@ void test_one() {
50
50
}
51
51
}
52
52
53
- void test () {
53
+ constexpr bool test () {
54
54
test_one<std::vector<int >>();
55
- test_one<std::deque<int >>();
55
+ #ifndef __cpp_lib_constexpr_deque
56
+ if (!TEST_IS_CONSTANT_EVALUATED)
57
+ #endif
58
+ test_one<std::deque<int >>();
56
59
test_one<MinSequenceContainer<int >>();
57
60
test_one<std::vector<int , min_allocator<int >>>();
61
+
62
+ return true ;
58
63
}
59
64
60
65
int main (int , char **) {
61
66
test ();
67
+ #if TEST_STD_VER >= 26
68
+ static_assert (test ());
69
+ #endif
62
70
63
71
return 0 ;
64
72
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ static_assert(!CanFind<NonTransparentSet>);
36
36
static_assert (!CanFind<const NonTransparentSet>);
37
37
38
38
template <class KeyContainer >
39
- void test_one () {
39
+ constexpr void test_one () {
40
40
using Key = typename KeyContainer::value_type;
41
41
using M = std::flat_multiset<Key, TransparentComparator, KeyContainer>;
42
42
@@ -77,9 +77,12 @@ void test_one() {
77
77
}
78
78
}
79
79
80
- void test () {
80
+ constexpr bool test () {
81
81
test_one<std::vector<std::string>>();
82
- test_one<std::deque<std::string>>();
82
+ #ifndef __cpp_lib_constexpr_deque
83
+ if (!TEST_IS_CONSTANT_EVALUATED)
84
+ #endif
85
+ test_one<std::deque<std::string>>();
83
86
test_one<MinSequenceContainer<std::string>>();
84
87
test_one<std::vector<std::string, min_allocator<std::string>>>();
85
88
@@ -101,10 +104,15 @@ void test() {
101
104
auto it2 = m.find (" charlie" );
102
105
assert (it2 == m.end ());
103
106
}
107
+
108
+ return true ;
104
109
}
105
110
106
111
int main (int , char **) {
107
112
test ();
113
+ #if TEST_STD_VER >= 26
114
+ static_assert (test ());
115
+ #endif
108
116
109
117
return 0 ;
110
118
}
Original file line number Diff line number Diff line change 24
24
#include " min_allocator.h"
25
25
26
26
template <class KeyContainer >
27
- void test_one () {
27
+ constexpr void test_one () {
28
28
using Key = typename KeyContainer::value_type;
29
29
{
30
30
using M = std::flat_multiset<Key, std::less<>, KeyContainer>;
@@ -66,15 +66,23 @@ void test_one() {
66
66
}
67
67
}
68
68
69
- void test () {
69
+ constexpr bool test () {
70
70
test_one<std::vector<int >>();
71
- test_one<std::deque<int >>();
71
+ #ifndef __cpp_lib_constexpr_deque
72
+ if (!TEST_IS_CONSTANT_EVALUATED)
73
+ #endif
74
+ test_one<std::deque<int >>();
72
75
test_one<MinSequenceContainer<int >>();
73
76
test_one<std::vector<int , min_allocator<int >>>();
77
+
78
+ return true ;
74
79
}
75
80
76
81
int main (int , char **) {
77
82
test ();
83
+ #if TEST_STD_VER >= 26
84
+ static_assert (test ());
85
+ #endif
78
86
79
87
return 0 ;
80
88
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ static_assert(!CanLowerBound<NonTransparentSet>);
36
36
static_assert (!CanLowerBound<const NonTransparentSet>);
37
37
38
38
template <class KeyContainer >
39
- void test_one () {
39
+ constexpr void test_one () {
40
40
using Key = typename KeyContainer::value_type;
41
41
using M = std::flat_multiset<Key, TransparentComparator, KeyContainer>;
42
42
@@ -83,9 +83,12 @@ void test_one() {
83
83
}
84
84
}
85
85
86
- void test () {
86
+ constexpr bool test () {
87
87
test_one<std::vector<std::string>>();
88
- test_one<std::deque<std::string>>();
88
+ #ifndef __cpp_lib_constexpr_deque
89
+ if (!TEST_IS_CONSTANT_EVALUATED)
90
+ #endif
91
+ test_one<std::deque<std::string>>();
89
92
test_one<MinSequenceContainer<std::string>>();
90
93
test_one<std::vector<std::string, min_allocator<std::string>>>();
91
94
@@ -107,10 +110,15 @@ void test() {
107
110
auto it2 = m.lower_bound (" charlie" );
108
111
assert (it2 == m.begin () + 3 );
109
112
}
113
+
114
+ return true ;
110
115
}
111
116
112
117
int main (int , char **) {
113
118
test ();
119
+ #if TEST_STD_VER >= 26
120
+ static_assert (test ());
121
+ #endif
114
122
115
123
return 0 ;
116
124
}
You can’t perform that action at this time.
0 commit comments