70 typedef T mapped_type;
80 typedef Compare key_compare;
86 typedef bool result_type;
89 return key_comp_(a.first, b.first);
92 friend class vector_map;
93 value_compare(
const key_compare& key_comp): key_comp_(key_comp) {}
94 key_compare key_comp_;
99 typedef typename std::allocator_traits<Allocator>::template rebind_alloc<value_type> allocator_type;
100 typedef typename std::allocator_traits<Allocator>::pointer
pointer;
101 typedef typename std::allocator_traits<Allocator>::const_pointer const_pointer;
102 typedef typename std::allocator_traits<Allocator>::size_type
size_type;
103 typedef typename std::allocator_traits<Allocator>::difference_type
difference_type;
105 typedef std::vector<value_type, Allocator> vector_type;
106 typedef typename vector_type::iterator iterator;
107 typedef typename vector_type::const_iterator const_iterator;
108 typedef typename vector_type::reverse_iterator reverse_iterator;
109 typedef typename vector_type::const_reverse_iterator const_reverse_iterator;
111 explicit vector_map(
const key_compare& key_comp = key_compare(),
const allocator_type& allocator = Allocator());
112 template <
typename InputIterator>
113 vector_map(InputIterator first, InputIterator last,
114 const key_compare& key_comp = key_compare(),
const allocator_type& allocator = Allocator());
117 vector_map(std::initializer_list<value_type> init,
118 const key_compare& key_comp = key_compare(),
const allocator_type& allocator = Allocator());
124 iterator begin() noexcept;
125 const_iterator begin() const noexcept;
126 const_iterator cbegin() const noexcept;
127 iterator end() noexcept;
128 const_iterator end() const noexcept;
129 const_iterator cend() const noexcept;
130 reverse_iterator rbegin() noexcept;
131 const_reverse_iterator rbegin() const noexcept;
132 const_reverse_iterator crbegin() const noexcept;
133 reverse_iterator rend() noexcept;
134 const_reverse_iterator rend() const noexcept;
135 const_reverse_iterator crend() const noexcept;
137 bool empty() const noexcept;
141 mapped_type& at(const key_type& key);
142 const mapped_type& at(const key_type& key) const;
143 mapped_type& operator[](const key_type& x);
144 mapped_type& operator[](key_type&& x);
146 std::pair<iterator,
bool> insert(const
value_type& x);
147 std::pair<iterator,
bool> insert(
value_type&& value);
148 iterator insert(const_iterator hint, const
value_type& x);
149 template <typename InputIterator>
void insert(InputIterator first, InputIterator last);
151 template<typename... Args> std::pair<iterator,
bool> emplace(Args&&... args);
152 template<typename... Args> iterator emplace_hint(const_iterator hint, Args&&... args);
153 template<typename... Args> std::pair<iterator,
bool> try_emplace(const key_type& key, Args&&... args);
154 template<typename... Args> std::pair<iterator,
bool> try_emplace(key_type&& key, Args&&... args);
155 template<typename... Args> iterator try_emplace(const_iterator hint, const key_type& key, Args&&... args);
156 template<typename... Args> iterator try_emplace(const_iterator hint, key_type&& key, Args&&... args);
158 void erase(const_iterator position);
160 void erase(const_iterator first, const_iterator last);
161 void swap(
vector_map<Key, T, Compare, Allocator>& other) noexcept;
162 void clear() noexcept;
164 key_compare key_comp() const;
165 value_compare value_comp() const;
167 iterator find(const key_type& x);
168 const_iterator find(const key_type& x) const;
169 size_type count(const key_type& x) const;
170 bool contains(const Key& key) const;
172 iterator lower_bound(const key_type& x);
173 const_iterator lower_bound(const key_type& x) const;
174 iterator upper_bound(const key_type& x);
175 const_iterator upper_bound(const key_type& x) const;
177 std::pair<iterator, iterator> equal_range(const key_type& x);
178 std::pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
182 bool is_insert_position(const_iterator hint, const key_type& x) const;
185 key_compare key_comp_;