Skip to content

Commit a29e302

Browse files
[libc++][test] Avoid narrowing operations in pair' constructors
... for test files for `flat_(multi)map` whenever feasible. Drive-by: Add `[[maybe_unused]]` to variables that are only used in `LIBCPP_ASSERT`. When testing MSVC STL, MSVC warns about such narrowing in `pair`'s constructors, even though the narrowing happens within direct-non-list-initialization.
1 parent 5cc2ae0 commit a29e302

27 files changed

+488
-105
lines changed

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/copy_assign.pass.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ int main(int, char**) {
2929
std::vector<char, test_allocator<char>> vs({2, 2, 1}, test_allocator<char>(7));
3030
using M = std::flat_map<int, char, C, decltype(ks), decltype(vs)>;
3131
auto mo = M(ks, vs, C(5));
32-
auto m = M({{3, 3}, {4, 4}, {5, 5}}, C(3), test_allocator<int>(2));
32+
auto m = M({{3, static_cast<char>(3)}, {4, static_cast<char>(4)}, {5, static_cast<char>(5)}},
33+
C(3),
34+
test_allocator<int>(2));
3335
m = mo;
3436

3537
assert(m.key_comp() == C(5));
@@ -54,7 +56,9 @@ int main(int, char**) {
5456
auto vs = Vs({2, 2, 1}, other_allocator<char>(7));
5557
using M = std::flat_map<int, char, C, Ks, Vs>;
5658
auto mo = M(Ks(ks, other_allocator<int>(6)), Vs(vs, other_allocator<int>(7)), C(5));
57-
auto m = M({{3, 3}, {4, 4}, {5, 5}}, C(3), other_allocator<int>(2));
59+
auto m = M({{3, static_cast<char>(3)}, {4, static_cast<char>(4)}, {5, static_cast<char>(5)}},
60+
C(3),
61+
other_allocator<int>(2));
5862
m = mo;
5963

6064
assert(m.key_comp() == C(5));

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/deduct.pass.cpp

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ using PC = std::pair<const int, long>;
3131

3232
void test_copy() {
3333
{
34-
std::flat_map<long, short> source = {{1, 2}, {2, 3}};
34+
std::flat_map<long, short> source = {{1, static_cast<short>(2)}, {2, static_cast<short>(3)}};
3535
std::flat_map s(source);
3636
ASSERT_SAME_TYPE(decltype(s), decltype(source));
3737
assert(s == source);
3838
}
3939
{
40-
std::flat_map<long, short, std::greater<long>> source = {{1, 2}, {2, 3}};
40+
std::flat_map<long, short, std::greater<long>> source = {{1, static_cast<short>(2)}, {2, static_cast<short>(3)}};
4141
std::flat_map s{source}; // braces instead of parens
4242
ASSERT_SAME_TYPE(decltype(s), decltype(source));
4343
assert(s == source);
4444
}
4545
{
46-
std::flat_map<long, short, std::greater<long>> source = {{1, 2}, {2, 3}};
46+
std::flat_map<long, short, std::greater<long>> source = {{1, static_cast<short>(2)}, {2, static_cast<short>(3)}};
4747
std::flat_map s(source, std::allocator<int>());
4848
ASSERT_SAME_TYPE(decltype(s), decltype(source));
4949
assert(s == source);
@@ -55,7 +55,11 @@ void test_containers() {
5555
std::deque<short, test_allocator<short>> vs({1, 2, 1, 4, 5}, test_allocator<int>(0, 43));
5656
std::deque<int, test_allocator<int>> sorted_ks({1, 2, 3, INT_MAX}, test_allocator<int>(0, 42));
5757
std::deque<short, test_allocator<short>> sorted_vs({1, 2, 5, 4}, test_allocator<int>(0, 43));
58-
const std::pair<int, short> expected[] = {{1, 1}, {2, 2}, {3, 5}, {INT_MAX, 4}};
58+
const std::pair<int, short> expected[] = {
59+
{1, static_cast<short>(1)},
60+
{2, static_cast<short>(2)},
61+
{3, static_cast<short>(5)},
62+
{INT_MAX, static_cast<short>(4)}};
5963
{
6064
std::flat_map s(ks, vs);
6165

@@ -95,7 +99,11 @@ void test_containers_compare() {
9599
std::deque<short, test_allocator<short>> vs({1, 2, 1, 4, 5}, test_allocator<int>(0, 43));
96100
std::deque<int, test_allocator<int>> sorted_ks({INT_MAX, 3, 2, 1}, test_allocator<int>(0, 42));
97101
std::deque<short, test_allocator<short>> sorted_vs({4, 5, 2, 1}, test_allocator<int>(0, 43));
98-
const std::pair<int, short> expected[] = {{INT_MAX, 4}, {3, 5}, {2, 2}, {1, 1}};
102+
const std::pair<int, short> expected[] = {
103+
{INT_MAX, static_cast<short>(4)},
104+
{3, static_cast<short>(5)},
105+
{2, static_cast<short>(2)},
106+
{1, static_cast<short>(1)}};
99107
{
100108
std::flat_map s(ks, vs, std::greater<int>());
101109

@@ -278,8 +286,17 @@ void test_initializer_list_compare() {
278286
}
279287

280288
void test_from_range() {
281-
std::list<std::pair<int, short>> r = {{1, 1}, {2, 2}, {1, 1}, {INT_MAX, 4}, {3, 5}};
282-
const std::pair<int, short> expected[] = {{1, 1}, {2, 2}, {3, 5}, {INT_MAX, 4}};
289+
std::list<std::pair<int, short>> r = {
290+
{1, static_cast<short>(1)},
291+
{2, static_cast<short>(2)},
292+
{1, static_cast<short>(1)},
293+
{INT_MAX, static_cast<short>(4)},
294+
{3, static_cast<short>(5)}};
295+
const std::pair<int, short> expected[] = {
296+
{1, static_cast<short>(1)},
297+
{2, static_cast<short>(2)},
298+
{3, static_cast<short>(5)},
299+
{INT_MAX, static_cast<short>(4)}};
283300
{
284301
std::flat_map s(std::from_range, r);
285302
ASSERT_SAME_TYPE(decltype(s), std::flat_map<int, short, std::less<int>>);
@@ -301,8 +318,17 @@ void test_from_range() {
301318
}
302319

303320
void test_from_range_compare() {
304-
std::list<std::pair<int, short>> r = {{1, 1}, {2, 2}, {1, 1}, {INT_MAX, 4}, {3, 5}};
305-
const std::pair<int, short> expected[] = {{INT_MAX, 4}, {3, 5}, {2, 2}, {1, 1}};
321+
std::list<std::pair<int, short>> r = {
322+
{1, static_cast<short>(1)},
323+
{2, static_cast<short>(2)},
324+
{1, static_cast<short>(1)},
325+
{INT_MAX, static_cast<short>(4)},
326+
{3, static_cast<short>(5)}};
327+
const std::pair<int, short> expected[] = {
328+
{INT_MAX, static_cast<short>(4)},
329+
{3, static_cast<short>(5)},
330+
{2, static_cast<short>(2)},
331+
{1, static_cast<short>(1)}};
306332
{
307333
std::flat_map s(std::from_range, r, std::greater<int>());
308334
ASSERT_SAME_TYPE(decltype(s), std::flat_map<int, short, std::greater<int>>);

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/deduct_pmr.pass.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ void test_containers() {
3535
std::deque<short, test_allocator<short>> vs({1, 2, 1, 4, 5}, test_allocator<int>(0, 43));
3636
std::deque<int, test_allocator<int>> sorted_ks({1, 2, 3, INT_MAX}, test_allocator<int>(0, 42));
3737
std::deque<short, test_allocator<short>> sorted_vs({1, 2, 5, 4}, test_allocator<int>(0, 43));
38-
const std::pair<int, short> expected[] = {{1, 1}, {2, 2}, {3, 5}, {INT_MAX, 4}};
38+
const std::pair<int, short> expected[] = {
39+
{1, static_cast<short>(1)},
40+
{2, static_cast<short>(2)},
41+
{3, static_cast<short>(5)},
42+
{INT_MAX, static_cast<short>(4)}};
3943
{
4044
std::pmr::monotonic_buffer_resource mr;
4145
std::pmr::monotonic_buffer_resource mr2;
@@ -69,7 +73,11 @@ void test_containers_compare() {
6973
std::deque<short, test_allocator<short>> vs({1, 2, 1, 4, 5}, test_allocator<int>(0, 43));
7074
std::deque<int, test_allocator<int>> sorted_ks({INT_MAX, 3, 2, 1}, test_allocator<int>(0, 42));
7175
std::deque<short, test_allocator<short>> sorted_vs({4, 5, 2, 1}, test_allocator<int>(0, 43));
72-
const std::pair<int, short> expected[] = {{INT_MAX, 4}, {3, 5}, {2, 2}, {1, 1}};
76+
const std::pair<int, short> expected[] = {
77+
{INT_MAX, static_cast<short>(4)},
78+
{3, static_cast<short>(5)},
79+
{2, static_cast<short>(2)},
80+
{1, static_cast<short>(1)}};
7381
{
7482
std::pmr::monotonic_buffer_resource mr;
7583
std::pmr::monotonic_buffer_resource mr2;

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/initializer_list.pass.cpp

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,42 @@ int main(int, char**) {
8282
!std::is_constructible_v<M, std::initializer_list<std::pair<const int, const short>>, std::allocator<int>>);
8383
}
8484

85-
std::pair<int, short> expected[] = {{1, 1}, {2, 2}, {3, 3}, {5, 2}};
85+
std::pair<int, short> expected[] = {
86+
{1, static_cast<short>(1)}, {2, static_cast<short>(2)}, {3, static_cast<short>(3)}, {5, static_cast<short>(2)}};
8687
{
8788
// flat_map(initializer_list<value_type>);
8889
using M = std::flat_map<int, short>;
89-
std::initializer_list<std::pair<int, short>> il = {{5, 2}, {2, 2}, {2, 2}, {3, 3}, {1, 1}, {3, 3}};
90+
std::initializer_list<std::pair<int, short>> il = {
91+
{5, static_cast<short>(2)},
92+
{2, static_cast<short>(2)},
93+
{2, static_cast<short>(2)},
94+
{3, static_cast<short>(3)},
95+
{1, static_cast<short>(1)},
96+
{3, static_cast<short>(3)}};
9097
M m(il);
9198
assert(std::equal(m.begin(), m.end(), expected, expected + 4));
9299
}
93100
{
94101
// flat_map(initializer_list<value_type>);
95102
// explicit(false)
96103
using M = std::flat_map<int, short>;
97-
M m = {{5, 2}, {2, 2}, {2, 2}, {3, 3}, {1, 1}, {3, 3}};
104+
M m = {{5, static_cast<short>(2)},
105+
{2, static_cast<short>(2)},
106+
{2, static_cast<short>(2)},
107+
{3, static_cast<short>(3)},
108+
{1, static_cast<short>(1)},
109+
{3, static_cast<short>(3)}};
98110
assert(std::equal(m.begin(), m.end(), expected, expected + 4));
99111
}
100112
{
101113
// flat_map(initializer_list<value_type>);
102114
using M = std::flat_map<int, short, std::greater<int>, std::deque<int, min_allocator<int>>>;
103-
M m = {{5, 2}, {2, 2}, {2, 2}, {3, 3}, {1, 1}, {3, 3}};
115+
M m = {{5, static_cast<short>(2)},
116+
{2, static_cast<short>(2)},
117+
{2, static_cast<short>(2)},
118+
{3, static_cast<short>(3)},
119+
{1, static_cast<short>(1)},
120+
{3, static_cast<short>(3)}};
104121
assert(std::equal(m.rbegin(), m.rend(), expected, expected + 4));
105122
}
106123
{
@@ -127,20 +144,40 @@ int main(int, char**) {
127144
// flat_map(initializer_list<value_type>, const key_compare&);
128145
using C = test_less<int>;
129146
using M = std::flat_map<int, short, C>;
130-
auto m = M({{5, 2}, {2, 2}, {2, 2}, {3, 3}, {1, 1}, {3, 3}}, C(10));
147+
auto m =
148+
M({{5, static_cast<short>(2)},
149+
{2, static_cast<short>(2)},
150+
{2, static_cast<short>(2)},
151+
{3, static_cast<short>(3)},
152+
{1, static_cast<short>(1)},
153+
{3, static_cast<short>(3)}},
154+
C(10));
131155
assert(std::equal(m.begin(), m.end(), expected, expected + 4));
132156
assert(m.key_comp() == C(10));
133157

134158
// explicit(false)
135-
M m2 = {{{5, 2}, {2, 2}, {2, 2}, {3, 3}, {1, 1}, {3, 3}}, C(10)};
159+
M m2 = {{{5, static_cast<short>(2)},
160+
{2, static_cast<short>(2)},
161+
{2, static_cast<short>(2)},
162+
{3, static_cast<short>(3)},
163+
{1, static_cast<short>(1)},
164+
{3, static_cast<short>(3)}},
165+
C(10)};
136166
assert(m2 == m);
137167
assert(m2.key_comp() == C(10));
138168
}
139169
{
140170
// flat_map(initializer_list<value_type>, const key_compare&);
141171
// Sorting uses the comparator that was passed in
142172
using M = std::flat_map<int, short, std::function<bool(int, int)>, std::deque<int, min_allocator<int>>>;
143-
auto m = M({{5, 2}, {2, 2}, {2, 2}, {3, 3}, {1, 1}, {3, 3}}, std::greater<int>());
173+
auto m =
174+
M({{5, static_cast<short>(2)},
175+
{2, static_cast<short>(2)},
176+
{2, static_cast<short>(2)},
177+
{3, static_cast<short>(3)},
178+
{1, static_cast<short>(1)},
179+
{3, static_cast<short>(3)}},
180+
std::greater<int>());
144181
assert(std::equal(m.rbegin(), m.rend(), expected, expected + 4));
145182
assert(m.key_comp()(2, 1) == true);
146183
}

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/iter_iter.pass.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,18 @@ int main(int, char**) {
5757
static_assert(!std::is_constructible_v<M3, Iter3, Iter3, const C&, const A2&>);
5858
}
5959

60-
using P = std::pair<int, short>;
61-
P ar[] = {{1, 1}, {1, 2}, {1, 3}, {2, 4}, {2, 5}, {3, 6}, {2, 7}, {3, 8}, {3, 9}};
62-
P expected[] = {{1, 1}, {2, 4}, {3, 6}};
60+
using P = std::pair<int, short>;
61+
P ar[] = {
62+
{1, static_cast<short>(1)},
63+
{1, static_cast<short>(2)},
64+
{1, static_cast<short>(3)},
65+
{2, static_cast<short>(4)},
66+
{2, static_cast<short>(5)},
67+
{3, static_cast<short>(6)},
68+
{2, static_cast<short>(7)},
69+
{3, static_cast<short>(8)},
70+
{3, static_cast<short>(9)}};
71+
P expected[] = {{1, static_cast<short>(1)}, {2, static_cast<short>(4)}, {3, static_cast<short>(6)}};
6372
{
6473
// flat_map(InputIterator , InputIterator)
6574
// cpp17_input_iterator

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/move_assign.pass.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ int main(int, char**) {
3232
using A1 = test_allocator<int>;
3333
using A2 = test_allocator<char>;
3434
using M = std::flat_map<int, char, C, std::vector<int, A1>, std::vector<char, A2>>;
35-
M mo = M({{1, 1}, {2, 3}, {3, 2}}, C(5), A1(7));
35+
M mo = M({{1, static_cast<char>(1)}, {2, static_cast<char>(3)}, {3, static_cast<char>(2)}}, C(5), A1(7));
3636
M m = M({}, C(3), A1(7));
3737
m = std::move(mo);
38-
assert((m == M{{1, 1}, {2, 3}, {3, 2}}));
38+
assert((m == M{{1, static_cast<char>(1)}, {2, static_cast<char>(3)}, {3, static_cast<char>(2)}}));
3939
assert(m.key_comp() == C(5));
4040
auto [ks, vs] = std::move(m).extract();
4141
assert(ks.get_allocator() == A1(7));
@@ -47,10 +47,15 @@ int main(int, char**) {
4747
using A1 = other_allocator<int>;
4848
using A2 = other_allocator<char>;
4949
using M = std::flat_map<int, char, C, std::deque<int, A1>, std::deque<char, A2>>;
50-
M mo = M({{4, 5}, {5, 4}}, C(5), A1(7));
51-
M m = M({{1, 1}, {2, 2}, {3, 3}, {4, 4}}, C(3), A1(7));
50+
M mo = M({{4, static_cast<char>(5)}, {5, static_cast<char>(4)}}, C(5), A1(7));
51+
M m = M({{1, static_cast<char>(1)}, //
52+
{2, static_cast<char>(2)},
53+
{3, static_cast<char>(3)},
54+
{4, static_cast<char>(4)}},
55+
C(3),
56+
A1(7));
5257
m = std::move(mo);
53-
assert((m == M{{4, 5}, {5, 4}}));
58+
assert((m == M{{4, static_cast<char>(5)}, {5, static_cast<char>(4)}}));
5459
assert(m.key_comp() == C(5));
5560
auto [ks, vs] = std::move(m).extract();
5661
assert(ks.get_allocator() == A1(7));

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/pmr.pass.cpp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,18 @@ int main(int, char**) {
166166
}
167167
{
168168
// flat_map(InputIterator first, InputIterator last, const Allocator& a);
169-
using P = std::pair<int, short>;
170-
P ar[] = {{1, 1}, {1, 2}, {1, 3}, {2, 4}, {2, 5}, {3, 6}, {2, 7}, {3, 8}, {3, 9}};
171-
P expected[] = {{1, 1}, {2, 4}, {3, 6}};
169+
using P = std::pair<int, short>;
170+
P ar[] = {
171+
{1, static_cast<short>(1)},
172+
{1, static_cast<short>(2)},
173+
{1, static_cast<short>(3)},
174+
{2, static_cast<short>(4)},
175+
{2, static_cast<short>(5)},
176+
{3, static_cast<short>(6)},
177+
{2, static_cast<short>(7)},
178+
{3, static_cast<short>(8)},
179+
{3, static_cast<short>(9)}};
180+
P expected[] = {{1, static_cast<short>(1)}, {2, static_cast<short>(4)}, {3, static_cast<short>(6)}};
172181
{
173182
// cpp17 iterator
174183
using M = std::flat_map<int, short, std::less<int>, std::pmr::vector<int>, std::pmr::vector<short>>;
@@ -242,9 +251,18 @@ int main(int, char**) {
242251
}
243252
{
244253
// flat_map(from_range_t, R&&, const Alloc&);
245-
using P = std::pair<int, short>;
246-
P ar[] = {{1, 1}, {1, 2}, {1, 3}, {2, 4}, {2, 5}, {3, 6}, {2, 7}, {3, 8}, {3, 9}};
247-
P expected[] = {{1, 1}, {2, 4}, {3, 6}};
254+
using P = std::pair<int, short>;
255+
P ar[] = {
256+
{1, static_cast<short>(1)},
257+
{1, static_cast<short>(2)},
258+
{1, static_cast<short>(3)},
259+
{2, static_cast<short>(4)},
260+
{2, static_cast<short>(5)},
261+
{3, static_cast<short>(6)},
262+
{2, static_cast<short>(7)},
263+
{3, static_cast<short>(8)},
264+
{3, static_cast<short>(9)}};
265+
P expected[] = {{1, static_cast<short>(1)}, {2, static_cast<short>(4)}, {3, static_cast<short>(6)}};
248266
{
249267
// input_range
250268
using M = std::flat_map<int, short, std::less<int>, std::pmr::vector<int>, std::pmr::vector<short>>;

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/range.pass.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,18 @@ int main(int, char**) {
117117
static_assert(!std::is_constructible_v<M, std::from_range_t, std::vector<NonPairLike>&, const C&, const A1&>);
118118
}
119119

120-
using P = std::pair<int, short>;
121-
P ar[] = {{1, 1}, {1, 2}, {1, 3}, {2, 4}, {2, 5}, {3, 6}, {2, 7}, {3, 8}, {3, 9}};
122-
P expected[] = {{1, 1}, {2, 4}, {3, 6}};
120+
using P = std::pair<int, short>;
121+
P ar[] = {
122+
{1, static_cast<short>(1)},
123+
{1, static_cast<short>(2)},
124+
{1, static_cast<short>(3)},
125+
{2, static_cast<short>(4)},
126+
{2, static_cast<short>(5)},
127+
{3, static_cast<short>(6)},
128+
{2, static_cast<short>(7)},
129+
{3, static_cast<short>(8)},
130+
{3, static_cast<short>(9)}};
131+
P expected[] = {{1, static_cast<short>(1)}, {2, static_cast<short>(4)}, {3, static_cast<short>(6)}};
123132
{
124133
// flat_map(from_range_t, R&&)
125134
// input_range && !common

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/sorted_container.pass.cpp

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,17 @@ int main(int, char**) {
6666
auto vs2 = vs;
6767

6868
auto m = M(std::sorted_unique, ks, vs);
69-
assert((m == M{{1, 4}, {2, 3}, {4, 2}, {10, 1}}));
69+
assert((m == M{{1, static_cast<char>(4)},
70+
{2, static_cast<char>(3)},
71+
{4, static_cast<char>(2)},
72+
{10, static_cast<char>(1)}}));
7073
m = M(std::sorted_unique, std::move(ks), std::move(vs));
7174
assert(ks.empty()); // it was moved-from
7275
assert(vs.empty()); // it was moved-from
73-
assert((m == M{{1, 4}, {2, 3}, {4, 2}, {10, 1}}));
76+
assert((m == M{{1, static_cast<char>(4)},
77+
{2, static_cast<char>(3)},
78+
{4, static_cast<char>(2)},
79+
{10, static_cast<char>(1)}}));
7480

7581
// explicit(false)
7682
M m2 = {std::sorted_unique, std::move(ks2), std::move(vs2)};
@@ -85,11 +91,17 @@ int main(int, char**) {
8591
Ks ks = {10, 4, 2, 1};
8692
Vs vs = {1, 2, 3, 4};
8793
auto m = M(std::sorted_unique, ks, vs);
88-
assert((m == M{{1, 4}, {2, 3}, {4, 2}, {10, 1}}));
94+
assert((m == M{{1, static_cast<char>(4)},
95+
{2, static_cast<char>(3)},
96+
{4, static_cast<char>(2)},
97+
{10, static_cast<char>(1)}}));
8998
m = M(std::sorted_unique, std::move(ks), std::move(vs));
9099
assert(ks.empty()); // it was moved-from
91100
assert(vs.empty()); // it was moved-from
92-
assert((m == M{{1, 4}, {2, 3}, {4, 2}, {10, 1}}));
101+
assert((m == M{{1, static_cast<char>(4)},
102+
{2, static_cast<char>(3)},
103+
{4, static_cast<char>(2)},
104+
{10, static_cast<char>(1)}}));
93105
}
94106
{
95107
// flat_map(sorted_unique_t, key_container_type , mapped_container_type)
@@ -113,7 +125,10 @@ int main(int, char**) {
113125
std::vector<char> vs = {4, 3, 2, 1};
114126

115127
auto m = M(std::sorted_unique, ks, vs, C(4));
116-
assert((m == M{{1, 4}, {2, 3}, {4, 2}, {10, 1}}));
128+
assert((m == M{{1, static_cast<char>(4)},
129+
{2, static_cast<char>(3)},
130+
{4, static_cast<char>(2)},
131+
{10, static_cast<char>(1)}}));
117132
assert(m.key_comp() == C(4));
118133

119134
// explicit(false)

0 commit comments

Comments
 (0)