Skip to content

Commit 7246f62

Browse files
committed
CI
1 parent 226edd3 commit 7246f62

File tree

6 files changed

+14
-33
lines changed

6 files changed

+14
-33
lines changed

libcxx/include/__flat_map/flat_map.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ class flat_map {
9090
using key_compare = __type_identity_t<_Compare>;
9191
using reference = pair<const key_type&, mapped_type&>;
9292
using const_reference = pair<const key_type&, const mapped_type&>;
93-
// TODO : to support vector<bool> in the future, the following typedefs need to replace the above
94-
// using reference = pair<ranges::range_reference_t<const _KeyContainer>,
95-
// ranges::range_reference_t<_MappedContainer>>; using const_reference =
96-
// pair<ranges::range_reference_t<const _KeyContainer>, ranges::range_reference_t<const _MappedContainer>>;
9793
using size_type = size_t;
9894
using difference_type = ptrdiff_t;
9995
using iterator = __iterator<false>; // see [container.requirements]
@@ -985,7 +981,7 @@ class flat_map {
985981
ranges::stable_sort(__zv.begin() + __append_start_offset, __end, __compare_key);
986982
} else {
987983
_LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(
988-
__is_sorted_and_unique(__containers_.keys | views::drop(__append_start_offset)),
984+
__is_sorted_and_unique(__containers_.keys | ranges::views::drop(__append_start_offset)),
989985
"Either the key container is not sorted or it contains duplicates");
990986
}
991987
ranges::inplace_merge(__zv.begin(), __zv.begin() + __append_start_offset, __end, __compare_key);
@@ -1074,14 +1070,6 @@ class flat_map {
10741070

10751071
template <class _Kp>
10761072
_LIBCPP_HIDE_FROM_ABI bool __is_hint_correct(const_iterator __hint, _Kp&& __key) {
1077-
// todo
1078-
// note that we have very fragile std::prev in our library
1079-
// for non LegacyBidirectional iterator, std::prev(it) is well formed and a no-op
1080-
// here we cannot use std::prev because our iterator is not legacy bidirectional
1081-
// since its reference type is not a reference
1082-
// note that user can also attempt to use std::prev on the flat_map::iterator
1083-
// and it would result in a no-op.
1084-
// we should probably ban std::prev(LegacyInputIterator)
10851073
if (__hint != cbegin() && !__compare_((__hint - 1)->first, __key)) {
10861074
return false;
10871075
}

libcxx/modules/std/flat_map.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
//===----------------------------------------------------------------------===//
99

1010
export namespace std {
11-
#if 0
12-
// [flat.map], class template flat_­map
11+
// [flat.map], class template flat_map
1312
using std::flat_map;
1413

1514
using std::sorted_unique;
1615
using std::sorted_unique_t;
1716

1817
using std::uses_allocator;
1918

20-
// [flat.map.erasure], erasure for flat_­map
19+
// [flat.map.erasure], erasure for flat_map
2120
using std::erase_if;
2221

23-
// [flat.multimap], class template flat_­multimap
22+
#if 0
23+
// [flat.multimap], class template flat_multimap
2424
using std::flat_multimap;
2525

2626
using std::sorted_equivalent;
2727
using std::sorted_equivalent_t;
2828

29-
// [flat.multimap.erasure], erasure for flat_­multimap
29+
// [flat.multimap.erasure], erasure for flat_multimap
3030
#endif
3131
} // namespace std

libcxx/test/std/containers/container.adaptors/flat.map.syn/sorted_unique.pass.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,9 @@ static_assert(std::is_trivially_default_constructible_v<std::sorted_unique_t>);
2929
static_assert(!HasImplicitDefaultCtor<std::sorted_unique_t>);
3030

3131
constexpr bool test() {
32-
{
33-
[[maybe_unused]] std::sorted_unique_t s;
34-
}
35-
{
36-
[[maybe_unused]] std::same_as<const std::sorted_unique_t&> decltype(auto) s = (std::sorted_unique);
37-
}
38-
{
39-
[[maybe_unused]] std::same_as<const std::sorted_unique_t> decltype(auto) copy = std::sorted_unique;
40-
}
32+
{ [[maybe_unused]] std::sorted_unique_t s; }
33+
{ [[maybe_unused]] std::same_as<const std::sorted_unique_t&> decltype(auto) s = (std::sorted_unique); }
34+
{ [[maybe_unused]] std::same_as<const std::sorted_unique_t> decltype(auto) copy = std::sorted_unique; }
4135

4236
return true;
4337
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ int main(int, char**) {
3737
using M1 = std::flat_map<int, int, C, V1, V1>;
3838
using M2 = std::flat_map<int, int, C, V1, V2>;
3939
using M3 = std::flat_map<int, int, C, V2, V1>;
40-
using IL = std::initializer_list<std::pair<int, int>>;
4140
static_assert(std::is_constructible_v<M1, const A1&>);
4241
static_assert(!std::is_constructible_v<M1, const A2&>);
4342
static_assert(!std::is_constructible_v<M2, const A2&>);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int main(int, char**) {
3737
using M1 = std::flat_map<int, int, C, V1, V1>;
3838
using M2 = std::flat_map<int, int, C, V1, V2>;
3939
using M3 = std::flat_map<int, int, C, V2, V1>;
40-
static_assert( std::is_constructible_v<M1, const M1&, const A1&>);
40+
static_assert(std::is_constructible_v<M1, const M1&, const A1&>);
4141
static_assert(!std::is_constructible_v<M1, const M1&, const A2&>);
4242
static_assert(!std::is_constructible_v<M2, const M2&, const A2&>);
4343
static_assert(!std::is_constructible_v<M3, const M3&, const A2&>);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int main(int, char**) {
3939
using M1 = std::flat_map<int, int, C, V1, V1>;
4040
using M2 = std::flat_map<int, int, C, V1, V2>;
4141
using M3 = std::flat_map<int, int, C, V2, V1>;
42-
static_assert( std::is_constructible_v<M1, M1&&, const A1&>);
42+
static_assert(std::is_constructible_v<M1, M1&&, const A1&>);
4343
static_assert(!std::is_constructible_v<M1, M1&&, const A2&>);
4444
static_assert(!std::is_constructible_v<M2, M2&&, const A2&>);
4545
static_assert(!std::is_constructible_v<M3, M3&&, const A2&>);
@@ -100,9 +100,9 @@ int main(int, char**) {
100100
{
101101
// moved-from object maintains invariant if one of underlying container does not clear after move
102102
using M = std::flat_map<int, int, std::less<>, std::vector<int>, CopyOnlyVector<int>>;
103-
M m1 = M({1,2,3},{1,2,3});
104-
M m2 (std::move(m1), std::allocator<int>{});
105-
assert(m2.size()==3);
103+
M m1 = M({1, 2, 3}, {1, 2, 3});
104+
M m2(std::move(m1), std::allocator<int>{});
105+
assert(m2.size() == 3);
106106
assert(m1.keys().size() == m1.values().size());
107107
LIBCPP_ASSERT(m1.empty());
108108
LIBCPP_ASSERT(m1.keys().size() == 0);

0 commit comments

Comments
 (0)