Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <linked_hash_map.h>
Public Types | |
using | key_type = Key |
using | mapped_type = Value |
using | hasher = KeyHash |
using | key_equal = KeyEq |
using | value_type = std::pair<const key_type, mapped_type> |
using | allocator_type = Alloc |
using | difference_type = ptrdiff_t |
using | iterator = typename ListType::iterator |
using | const_iterator = typename ListType::const_iterator |
using | reverse_iterator = typename ListType::reverse_iterator |
using | const_reverse_iterator = typename ListType::const_reverse_iterator |
using | reference = typename ListType::reference |
using | const_reference = typename ListType::const_reference |
using | size_type = typename ListType::size_type |
using | pointer = typename std::allocator_traits<allocator_type>::pointer |
using | const_pointer |
using | node_type = NodeHandle |
using | insert_return_type = InsertReturnType<iterator, node_type> |
Public Member Functions | |
linked_hash_map ()=default | |
linked_hash_map (size_t bucket_count, const hasher &hash=hasher(), const key_equal &eq=key_equal(), const allocator_type &alloc=allocator_type()) | |
linked_hash_map (size_t bucket_count, const hasher &hash, const allocator_type &alloc) | |
linked_hash_map (size_t bucket_count, const allocator_type &alloc) | |
linked_hash_map (const allocator_type &alloc) | |
template<class InputIt > | |
linked_hash_map (InputIt first, InputIt last, size_t bucket_count=0, const hasher &hash=hasher(), const key_equal &eq=key_equal(), const allocator_type &alloc=allocator_type()) | |
template<class InputIt > | |
linked_hash_map (InputIt first, InputIt last, size_t bucket_count, const hasher &hash, const allocator_type &alloc) | |
template<class InputIt > | |
linked_hash_map (InputIt first, InputIt last, size_t bucket_count, const allocator_type &alloc) | |
template<class InputIt > | |
linked_hash_map (InputIt first, InputIt last, const allocator_type &alloc) | |
linked_hash_map (std::initializer_list< value_type > init, size_t bucket_count=0, const hasher &hash=hasher(), const key_equal &eq=key_equal(), const allocator_type &alloc=allocator_type()) | |
linked_hash_map (std::initializer_list< value_type > init, size_t bucket_count, const hasher &hash, const allocator_type &alloc) | |
linked_hash_map (std::initializer_list< value_type > init, size_t bucket_count, const allocator_type &alloc) | |
linked_hash_map (std::initializer_list< value_type > init, const allocator_type &alloc) | |
linked_hash_map (const linked_hash_map &other) | |
linked_hash_map (const linked_hash_map &other, const allocator_type &alloc) | |
linked_hash_map (linked_hash_map &&other) noexcept | |
linked_hash_map (linked_hash_map &&other, const allocator_type &alloc) | |
linked_hash_map & | operator= (const linked_hash_map &other) |
linked_hash_map & | operator= (linked_hash_map &&other) noexcept |
linked_hash_map & | operator= (std::initializer_list< value_type > values) |
size_type | size () const |
Derive size_ from set_, as list::size might be O(N). | |
size_type | max_size () const noexcept |
bool | empty () const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
reverse_iterator | rbegin () |
reverse_iterator | rend () |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | rend () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | crend () const |
reference | front () |
reference | back () |
const_reference | front () const |
const_reference | back () const |
void | pop_front () |
void | pop_back () |
ABSL_ATTRIBUTE_REINITIALIZES void | clear () |
void | reserve (size_t n) |
size_t | capacity () const |
size_t | bucket_count () const |
float | load_factor () const |
hasher | hash_function () const |
key_equal | key_eq () const |
allocator_type | get_allocator () const |
template<class K = key_type> | |
size_type | erase (const key_arg< K > &key) |
iterator | erase (const_iterator position) |
iterator | erase (iterator position) |
iterator | erase (iterator first, iterator last) |
iterator | erase (const_iterator first, const_iterator last) |
template<class K = key_type> | |
iterator | find (const key_arg< K > &key) |
template<class K = key_type> | |
const_iterator | find (const key_arg< K > &key) const |
template<class K = key_type> | |
size_type | count (const key_arg< K > &key) const |
template<class K = key_type> | |
bool | contains (const key_arg< K > &key) const |
template<class K = key_type> | |
mapped_type & | at (const key_arg< K > &key) |
template<class K = key_type> | |
const mapped_type & | at (const key_arg< K > &key) const |
template<class K = key_type> | |
std::pair< iterator, iterator > | equal_range (const key_arg< K > &key) |
template<class K = key_type> | |
std::pair< const_iterator, const_iterator > | equal_range (const key_arg< K > &key) const |
template<class K = key_type> | |
mapped_type & | operator[] (const key_arg< K > &key) |
template<class K = key_type, K * = nullptr> | |
mapped_type & | operator[] (key_arg< K > &&key) |
std::pair< iterator, bool > | insert (const value_type &v) |
std::pair< iterator, bool > | insert (value_type &&v) |
iterator | insert (const_iterator, const value_type &v) |
iterator | insert (const_iterator, value_type &&v) |
void | insert (std::initializer_list< value_type > ilist) |
template<class InputIt > | |
void | insert (InputIt first, InputIt last) |
insert_return_type | insert (node_type &&node) |
iterator | insert (const_iterator, node_type &&node) |
template<class K = key_type, class V = mapped_type, K * = nullptr, V * = nullptr> | |
std::pair< iterator, bool > | insert_or_assign (key_arg< K > &&k, V &&v) |
template<class K = key_type, class V = mapped_type, K * = nullptr> | |
std::pair< iterator, bool > | insert_or_assign (key_arg< K > &&k, const V &v) |
template<class K = key_type, class V = mapped_type, V * = nullptr> | |
std::pair< iterator, bool > | insert_or_assign (const key_arg< K > &k, V &&v) |
template<class K = key_type, class V = mapped_type> | |
std::pair< iterator, bool > | insert_or_assign (const key_arg< K > &k, const V &v) |
template<class K = key_type, class V = mapped_type, K * = nullptr, V * = nullptr> | |
iterator | insert_or_assign (const_iterator, key_arg< K > &&k, V &&v) |
template<class K = key_type, class V = mapped_type, K * = nullptr> | |
iterator | insert_or_assign (const_iterator, key_arg< K > &&k, const V &v) |
template<class K = key_type, class V = mapped_type, V * = nullptr> | |
iterator | insert_or_assign (const_iterator, const key_arg< K > &k, V &&v) |
template<class K = key_type, class V = mapped_type> | |
iterator | insert_or_assign (const_iterator, const key_arg< K > &k, const V &v) |
template<typename... Args> | |
std::pair< iterator, bool > | emplace (Args &&... args) |
template<class K = key_type, class... Args, K * = nullptr> | |
iterator | try_emplace (const_iterator, key_arg< K > &&k, Args &&... args) |
template<typename... Args> | |
iterator | emplace_hint (const_iterator, Args &&... args) |
template<class K = key_type, typename... Args, K * = nullptr> | |
std::pair< iterator, bool > | try_emplace (key_arg< K > &&key, Args &&... args) |
template<typename H , typename E > | |
void | merge (linked_hash_map< Key, Value, H, E, Alloc > &src) |
template<typename H , typename E > | |
void | merge (linked_hash_map< Key, Value, H, E, Alloc > &&src) |
node_type | extract (const_iterator position) |
template<class K = key_type, std::enable_if_t<!std::is_same_v< K, iterator >, int > = 0> | |
node_type | extract (const key_arg< K > &key) |
template<class K = key_type, typename... Args> | |
std::pair< iterator, bool > | try_emplace (const key_arg< K > &key, Args &&... args) |
void | swap (linked_hash_map &other) |
void | rehash (size_t n) |
Friends | |
bool | operator== (const linked_hash_map &a, const linked_hash_map &b) |
bool | operator!= (const linked_hash_map &a, const linked_hash_map &b) |
This holds a list of pair<Key, Value> items. This list is what gets traversed, and it's iterators from this list that we return from begin/end/find.
We also keep a set<list::iterator> for find. Since std::list is a doubly-linked list, the iterators should remain stable.
Definition at line 52 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::allocator_type = Alloc |
Definition at line 69 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::const_iterator = typename ListType::const_iterator |
Definition at line 141 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::const_pointer |
Definition at line 148 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::const_reference = typename ListType::const_reference |
Definition at line 145 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::const_reverse_iterator = typename ListType::const_reverse_iterator |
Definition at line 143 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::difference_type = ptrdiff_t |
Definition at line 70 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::hasher = KeyHash |
Definition at line 66 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::insert_return_type = InsertReturnType<iterator, node_type> |
Definition at line 151 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::iterator = typename ListType::iterator |
Definition at line 140 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::key_equal = KeyEq |
Definition at line 67 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::key_type = Key |
Definition at line 64 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::mapped_type = Value |
Definition at line 65 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::node_type = NodeHandle |
Definition at line 150 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::pointer = typename std::allocator_traits<allocator_type>::pointer |
Definition at line 147 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::reference = typename ListType::reference |
Definition at line 144 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::reverse_iterator = typename ListType::reverse_iterator |
Definition at line 142 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::size_type = typename ListType::size_type |
Definition at line 146 of file linked_hash_map.h.
using gtl::linked_hash_map< Key, Value, KeyHash, KeyEq, Alloc >::value_type = std::pair<const key_type, mapped_type> |
Definition at line 68 of file linked_hash_map.h.
|
default |
|
inlineexplicit |
Definition at line 155 of file linked_hash_map.h.
|
inline |
Definition at line 162 of file linked_hash_map.h.
|
inline |
Definition at line 166 of file linked_hash_map.h.
|
inlineexplicit |
Definition at line 169 of file linked_hash_map.h.
|
inline |
Definition at line 173 of file linked_hash_map.h.
|
inline |
Definition at line 182 of file linked_hash_map.h.
|
inline |
Definition at line 187 of file linked_hash_map.h.
|
inline |
Definition at line 193 of file linked_hash_map.h.
|
inline |
Definition at line 197 of file linked_hash_map.h.
|
inline |
Definition at line 204 of file linked_hash_map.h.
|
inline |
Definition at line 208 of file linked_hash_map.h.
|
inline |
Definition at line 212 of file linked_hash_map.h.
|
inline |
Definition at line 217 of file linked_hash_map.h.
|
inline |
Definition at line 223 of file linked_hash_map.h.
|
inlinenoexcept |
Since the list and set must agree for other to end up "valid", explicitly clear them.
Definition at line 229 of file linked_hash_map.h.
|
inline |
Definition at line 237 of file linked_hash_map.h.
|
inline |
Definition at line 371 of file linked_hash_map.h.
|
inline |
Definition at line 380 of file linked_hash_map.h.
|
inline |
Definition at line 292 of file linked_hash_map.h.
|
inline |
Definition at line 294 of file linked_hash_map.h.
|
inline |
Iteration is list-like, in insertion order. These are all forwarded.
Definition at line 279 of file linked_hash_map.h.
|
inline |
Definition at line 281 of file linked_hash_map.h.
|
inline |
Definition at line 306 of file linked_hash_map.h.
|
inline |
Definition at line 305 of file linked_hash_map.h.
|
inline |
Definition at line 283 of file linked_hash_map.h.
|
inline |
Definition at line 284 of file linked_hash_map.h.
|
inline |
Definition at line 299 of file linked_hash_map.h.
|
inline |
Definition at line 366 of file linked_hash_map.h.
|
inline |
Definition at line 362 of file linked_hash_map.h.
|
inline |
Definition at line 289 of file linked_hash_map.h.
|
inline |
Definition at line 290 of file linked_hash_map.h.
|
inline |
Definition at line 495 of file linked_hash_map.h.
|
inline |
Definition at line 511 of file linked_hash_map.h.
|
inline |
Definition at line 275 of file linked_hash_map.h.
|
inline |
Definition at line 280 of file linked_hash_map.h.
|
inline |
Definition at line 282 of file linked_hash_map.h.
|
inline |
Definition at line 385 of file linked_hash_map.h.
|
inline |
Definition at line 392 of file linked_hash_map.h.
|
inline |
Erase set entry first since it refers to the list element.
Definition at line 314 of file linked_hash_map.h.
|
inline |
Definition at line 341 of file linked_hash_map.h.
|
inline |
Definition at line 324 of file linked_hash_map.h.
|
inline |
Definition at line 336 of file linked_hash_map.h.
|
inline |
Definition at line 332 of file linked_hash_map.h.
|
inline |
Definition at line 547 of file linked_hash_map.h.
|
inline |
Definition at line 538 of file linked_hash_map.h.
|
inline |
Definition at line 348 of file linked_hash_map.h.
|
inline |
Definition at line 355 of file linked_hash_map.h.
|
inline |
Definition at line 291 of file linked_hash_map.h.
|
inline |
Definition at line 293 of file linked_hash_map.h.
|
inline |
Definition at line 311 of file linked_hash_map.h.
|
inline |
Definition at line 309 of file linked_hash_map.h.
|
inline |
Definition at line 409 of file linked_hash_map.h.
|
inline |
Definition at line 416 of file linked_hash_map.h.
|
inline |
Definition at line 441 of file linked_hash_map.h.
|
inline |
Definition at line 419 of file linked_hash_map.h.
|
inline |
Definition at line 428 of file linked_hash_map.h.
|
inline |
Definition at line 432 of file linked_hash_map.h.
|
inline |
Definition at line 423 of file linked_hash_map.h.
|
inline |
Definition at line 412 of file linked_hash_map.h.
|
inline |
Definition at line 469 of file linked_hash_map.h.
|
inline |
Definition at line 464 of file linked_hash_map.h.
|
inline |
Definition at line 490 of file linked_hash_map.h.
|
inline |
Definition at line 485 of file linked_hash_map.h.
|
inline |
Definition at line 480 of file linked_hash_map.h.
|
inline |
Definition at line 475 of file linked_hash_map.h.
|
inline |
Definition at line 459 of file linked_hash_map.h.
|
inline |
The last two template parameters ensure that both arguments are rvalues (lvalue arguments are handled by the overloads below). This is necessary for supporting bitfield arguments.
union { int n : 1; }; linked_hash_map<int, int> m; m.insert_or_assign(n, n);
Definition at line 454 of file linked_hash_map.h.
|
inline |
Definition at line 310 of file linked_hash_map.h.
|
inline |
Definition at line 307 of file linked_hash_map.h.
|
inlinenoexcept |
Definition at line 274 of file linked_hash_map.h.
|
inline |
Definition at line 534 of file linked_hash_map.h.
|
inline |
Definition at line 522 of file linked_hash_map.h.
|
inline |
Make a new set, with other's hash/eq/alloc.
Copy the list, with other's allocator.
Definition at line 246 of file linked_hash_map.h.
|
inlinenoexcept |
underlying containers will handle progagate_on_container_move details
Definition at line 257 of file linked_hash_map.h.
|
inline |
Definition at line 266 of file linked_hash_map.h.
|
inline |
Definition at line 400 of file linked_hash_map.h.
|
inline |
Definition at line 405 of file linked_hash_map.h.
|
inline |
Definition at line 297 of file linked_hash_map.h.
|
inline |
Definition at line 296 of file linked_hash_map.h.
|
inline |
Definition at line 285 of file linked_hash_map.h.
|
inline |
Definition at line 287 of file linked_hash_map.h.
|
inline |
Definition at line 581 of file linked_hash_map.h.
|
inline |
Definition at line 286 of file linked_hash_map.h.
|
inline |
Definition at line 288 of file linked_hash_map.h.
|
inline |
Definition at line 304 of file linked_hash_map.h.
|
inline |
Derive size_ from set_, as list::size might be O(N).
Definition at line 273 of file linked_hash_map.h.
|
inline |
Definition at line 557 of file linked_hash_map.h.
|
inline |
Definition at line 553 of file linked_hash_map.h.
|
inline |
Definition at line 506 of file linked_hash_map.h.
|
inline |
Definition at line 516 of file linked_hash_map.h.
|
friend |
Definition at line 577 of file linked_hash_map.h.
|
friend |
Definition at line 563 of file linked_hash_map.h.