|
| unordered_map () |
|
| unordered_map (const allocator_type &alloc) |
|
| unordered_map (size_type bucketCount, const allocator_type &alloc=allocator_type()) |
|
| unordered_map (size_type bucketCount, const hasher &hashFunc, const allocator_type &alloc=allocator_type()) |
|
| unordered_map (size_type bucketCount, const hasher &hashFunc, const key_equal &equalFunc, const allocator_type &alloc=allocator_type()) |
|
template<typename Iterator > |
| unordered_map (Iterator first, Iterator last) |
|
template<typename Iterator > |
| unordered_map (Iterator first, Iterator last, size_type bucketCount, const allocator_type &alloc=allocator_type()) |
|
template<typename Iterator > |
| unordered_map (Iterator first, Iterator last, size_type bucketCount, const hasher &hashFunc, const allocator_type &alloc=allocator_type()) |
|
template<typename Iterator > |
| unordered_map (Iterator first, Iterator last, size_type bucketCount, const hasher &hashFunc, const key_equal &equalFunc, const allocator_type &alloc=allocator_type()) |
|
| unordered_map (std::initializer_list< value_type > values) |
|
| unordered_map (std::initializer_list< value_type > values, size_type bucketCount, const allocator_type &alloc=allocator_type()) |
|
| unordered_map (std::initializer_list< value_type > values, size_type bucketCount, const hasher &hashFunc, const allocator_type &alloc=allocator_type()) |
|
| unordered_map (std::initializer_list< value_type > values, size_type bucketCount, const hasher &hashFunc, const key_equal &equalFunc, const allocator_type &alloc=allocator_type()) |
|
| unordered_map (unordered_map &&right) noexcept |
|
| unordered_map (unordered_map &&right, const momo::internal::Identity< allocator_type > &alloc) noexcept(std::is_empty< allocator_type >::value) |
|
| unordered_map (const unordered_map &right) |
|
| unordered_map (const unordered_map &right, const momo::internal::Identity< allocator_type > &alloc) |
|
| ~unordered_map ()=default |
|
unordered_map & | operator= (unordered_map &&right) noexcept(std::is_empty< allocator_type >::value||std::allocator_traits< allocator_type >::propagate_on_container_move_assignment::value) |
|
unordered_map & | operator= (const unordered_map &right) |
|
unordered_map & | operator= (std::initializer_list< value_type > values) |
|
void | swap (unordered_map &right) noexcept |
|
const nested_container_type & | get_nested_container () const noexcept |
|
nested_container_type & | get_nested_container () noexcept |
|
const_iterator | begin () const noexcept |
|
iterator | begin () noexcept |
|
const_iterator | end () const noexcept |
|
iterator | end () noexcept |
|
const_iterator | cbegin () const noexcept |
|
const_iterator | cend () const noexcept |
|
float | max_load_factor () const noexcept |
|
void | max_load_factor (float maxLoadFactor) |
|
hasher | hash_function () const |
|
key_equal | key_eq () const |
|
allocator_type | get_allocator () const noexcept |
|
size_type | max_size () const noexcept |
|
size_type | size () const noexcept |
|
MOMO_NODISCARD bool | empty () const noexcept |
|
void | clear () noexcept |
|
void | rehash (size_type bucketCount) |
|
void | reserve (size_type count) |
|
MOMO_FORCEINLINE const_iterator | find (const key_type &key) const |
|
MOMO_FORCEINLINE iterator | find (const key_type &key) |
|
template<typename KeyArg > |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, const_iterator > | find (const KeyArg &key) const |
|
template<typename KeyArg > |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, iterator > | find (const KeyArg &key) |
|
MOMO_FORCEINLINE size_type | count (const key_type &key) const |
|
template<typename KeyArg > |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, size_type > | count (const KeyArg &key) const |
|
MOMO_FORCEINLINE bool | contains (const key_type &key) const |
|
template<typename KeyArg > |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, bool > | contains (const KeyArg &key) const |
|
MOMO_FORCEINLINE std::pair< const_iterator, const_iterator > | equal_range (const key_type &key) const |
|
MOMO_FORCEINLINE std::pair< iterator, iterator > | equal_range (const key_type &key) |
|
template<typename KeyArg > |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, std::pair< const_iterator, const_iterator > > | equal_range (const KeyArg &key) const |
|
template<typename KeyArg > |
MOMO_FORCEINLINE momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, std::pair< iterator, iterator > > | equal_range (const KeyArg &key) |
|
std::pair< iterator, bool > | insert (std::pair< key_type, mapped_type > &&value) |
|
iterator | insert (const_iterator hint, std::pair< key_type, mapped_type > &&value) |
|
template<typename First , typename Second > |
momo::internal::EnableIf< std::is_constructible< key_type, const First & >::value &&std::is_constructible< mapped_type, const Second & >::value, std::pair< iterator, bool > > | insert (const std::pair< First, Second > &value) |
|
template<typename First , typename Second > |
momo::internal::EnableIf< std::is_constructible< key_type, const First & >::value &&std::is_constructible< mapped_type, const Second & >::value, iterator > | insert (const_iterator hint, const std::pair< First, Second > &value) |
|
template<typename First , typename Second > |
momo::internal::EnableIf< std::is_constructible< key_type, First && >::value &&std::is_constructible< mapped_type, Second && >::value, std::pair< iterator, bool > > | insert (std::pair< First, Second > &&value) |
|
template<typename First , typename Second > |
momo::internal::EnableIf< std::is_constructible< key_type, First && >::value &&std::is_constructible< mapped_type, Second && >::value, iterator > | insert (const_iterator hint, std::pair< First, Second > &&value) |
|
insert_return_type | insert (node_type &&node) |
|
iterator | insert (const_iterator hint, node_type &&node) |
|
template<typename Iterator > |
void | insert (Iterator first, Iterator last) |
|
void | insert (std::initializer_list< value_type > values) |
|
std::pair< iterator, bool > | emplace () |
|
iterator | emplace_hint (const_iterator hint) |
|
template<typename ValueArg > |
std::pair< iterator, bool > | emplace (ValueArg &&valueArg) |
|
template<typename ValueArg > |
iterator | emplace_hint (const_iterator hint, ValueArg &&valueArg) |
|
template<typename KeyArg , typename MappedArg > |
std::pair< iterator, bool > | emplace (KeyArg &&keyArg, MappedArg &&mappedArg) |
|
template<typename KeyArg , typename MappedArg > |
iterator | emplace_hint (const_iterator hint, KeyArg &&keyArg, MappedArg &&mappedArg) |
|
template<typename... KeyArgs, typename... MappedArgs> |
std::pair< iterator, bool > | emplace (std::piecewise_construct_t, std::tuple< KeyArgs... > keyArgs, std::tuple< MappedArgs... > mappedArgs) |
|
template<typename... KeyArgs, typename... MappedArgs> |
iterator | emplace_hint (const_iterator hint, std::piecewise_construct_t, std::tuple< KeyArgs... > keyArgs, std::tuple< MappedArgs... > mappedArgs) |
|
iterator | erase (const_iterator where) |
|
iterator | erase (iterator where) |
|
iterator | erase (const_iterator first, const_iterator last) |
|
size_type | erase (const key_type &key) |
|
MOMO_FORCEINLINE HashMap::ValueReferenceRKey | operator[] (key_type &&key) |
|
MOMO_FORCEINLINE HashMap::ValueReferenceCKey | operator[] (const key_type &key) |
|
MOMO_FORCEINLINE const mapped_type & | at (const key_type &key) const |
|
MOMO_FORCEINLINE mapped_type & | at (const key_type &key) |
|
template<typename... MappedArgs> |
std::pair< iterator, bool > | try_emplace (key_type &&key, MappedArgs &&... mappedArgs) |
|
template<typename... MappedArgs> |
iterator | try_emplace (const_iterator hint, key_type &&key, MappedArgs &&... mappedArgs) |
|
template<typename... MappedArgs> |
std::pair< iterator, bool > | try_emplace (const key_type &key, MappedArgs &&... mappedArgs) |
|
template<typename... MappedArgs> |
iterator | try_emplace (const_iterator hint, const key_type &key, MappedArgs &&... mappedArgs) |
|
template<typename MappedArg > |
std::pair< iterator, bool > | insert_or_assign (key_type &&key, MappedArg &&mappedArg) |
|
template<typename MappedArg > |
iterator | insert_or_assign (const_iterator hint, key_type &&key, MappedArg &&mappedArg) |
|
template<typename MappedArg > |
std::pair< iterator, bool > | insert_or_assign (const key_type &key, MappedArg &&mappedArg) |
|
template<typename MappedArg > |
iterator | insert_or_assign (const_iterator hint, const key_type &key, MappedArg &&mappedArg) |
|
node_type | extract (const_iterator where) |
|
node_type | extract (const key_type &key) |
|
template<typename Map > |
void | merge (Map &&map) |
|
size_type | max_bucket_count () const noexcept |
|
size_type | bucket_count () const noexcept |
|
size_type | bucket_size (size_type bucketIndex) const |
|
local_iterator | begin (size_type bucketIndex) |
|
const_local_iterator | begin (size_type bucketIndex) const |
|
local_iterator | end (size_type bucketIndex) |
|
const_local_iterator | end (size_type bucketIndex) const |
|
const_local_iterator | cbegin (size_type bucketIndex) const |
|
const_local_iterator | cend (size_type bucketIndex) const |
|
size_type | bucket (const key_type &key) const |
|
float | load_factor () const noexcept |
|
bool | operator== (const unordered_map &right) const |
|
bool | operator!= (const unordered_map &right) const |
|
template<typename TKey, typename TMapped, typename THashFunc = HashCoder<TKey>, typename TEqualFunc = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename THashMap = HashMap<TKey, TMapped, HashTraitsStd<TKey, THashFunc, TEqualFunc>, MemManagerStd<TAllocator>>>
class momo::stdish::unordered_map< TKey, TMapped, THashFunc, TEqualFunc, TAllocator, THashMap >
momo::stdish::unordered_map
is similar to std::unordered_map
, but much more efficient in memory usage. The implementation is based on hash table with buckets in the form of small arrays.
Deviations from the std::unordered_map
:
- Container items must be movable (preferably without exceptions) or copyable, similar to items of
std::vector
.
- After each addition or removal of the item all iterators and references to items become invalid and should not be used.
- Type
reference
is not the same as value_type&
, so for (auto& p : map)
is illegal, but for (auto p : map)
or for (const auto& p : map)
or for (auto&& p : map)
is allowed.
- Functions
clear
, begin
, cbegin
and iterator increment take O(bucket_count) time in worst case.
- If
ObjectManager<key_type>::isNothrowAnywayAssignable
is false or ObjectManager<mapped_type>::isNothrowAnywayAssignable
is false, functions erase
can throw exceptions.
- Functions
merge
, extract
and insert(node_type&&)
move items.
It is allowed to pass to functions insert
and emplace
references to items within the container.