Skip to content

Commit a1ae892

Browse files
Hui XieHui Xie
authored andcommitted
review comments
1 parent e95ebf2 commit a1ae892

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

libcxx/include/__flat_map/flat_map.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ template <ranges::input_range _Range,
11901190
class _Allocator = allocator<byte>,
11911191
class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>
11921192
flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
1193-
->flat_map<
1193+
-> flat_map<
11941194
__range_key_type<_Range>,
11951195
__range_mapped_type<_Range>,
11961196
_Compare,
@@ -1199,7 +1199,7 @@ flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator(
11991199

12001200
template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>
12011201
flat_map(from_range_t, _Range&&, _Allocator)
1202-
->flat_map<
1202+
-> flat_map<
12031203
__range_key_type<_Range>,
12041204
__range_mapped_type<_Range>,
12051205
less<__range_key_type<_Range>>,

libcxx/include/__flat_map/key_value_iterator.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ _LIBCPP_PUSH_MACROS
3232

3333
_LIBCPP_BEGIN_NAMESPACE_STD
3434

35+
/**
36+
* __key_value_iterator is a proxy iterator which zips the underlying
37+
* _KeyContainer::iterator and the underlying _MappedContainer::iterator.
38+
* The two underlying iterators will be incremented/decremented together.
39+
* And the reference is a pair of the const key reference and the value reference.
40+
*/
3541
template <class _Owner, class _KeyContainer, class _MappedContainer, bool _Const>
3642
struct __key_value_iterator {
3743
private:
@@ -54,7 +60,7 @@ struct __key_value_iterator {
5460

5561
public:
5662
using iterator_concept = random_access_iterator_tag;
57-
// `flat_map::iterator` only satisfy "Cpp17InputIterator" named requirements, because
63+
// `__key_value_iterator` only satisfy "Cpp17InputIterator" named requirements, because
5864
// its `reference` is not a reference type.
5965
// However, to avoid surprising runtime behaviour when it is used with the
6066
// Cpp17 algorithms or operations, iterator_category is set to random_access_iterator_tag.

libcxx/include/flat_map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ namespace std {
4040
#include <__assert> // all public C++ headers provide the assertion handler
4141
#include <__config>
4242
#include <__flat_map/flat_map.h>
43-
#include <__flat_map/key_value_iterator.h>
4443
#include <__flat_map/sorted_unique.h>
4544
#include <version>
4645

0 commit comments

Comments
 (0)