momo::stdish::unordered_map_open
is similar to std::unordered_map
, but much more efficient in operation speed. The implementation is based on open addressing hash table.
More...
#include <unordered_map.h>
template<typename TKey, typename TMapped, typename THasher = HashCoder<TKey>, typename TEqualComparer = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
class momo::stdish::unordered_map_open< TKey, TMapped, THasher, TEqualComparer, TAllocator >
momo::stdish::unordered_map_open
is similar to std::unordered_map
, but much more efficient in operation speed. The implementation is based on open addressing hash table.
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.
◆ const_reference
template<typename TKey , typename TMapped , typename THasher = HashCoder<TKey>, typename TEqualComparer = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
◆ key_type
template<typename TKey , typename TMapped , typename THasher = HashCoder<TKey>, typename TEqualComparer = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
◆ mapped_type
template<typename TKey , typename TMapped , typename THasher = HashCoder<TKey>, typename TEqualComparer = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
◆ size_type
template<typename TKey , typename TMapped , typename THasher = HashCoder<TKey>, typename TEqualComparer = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
◆ value_type
template<typename TKey , typename TMapped , typename THasher = HashCoder<TKey>, typename TEqualComparer = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
◆ operator=()
template<typename TKey , typename TMapped , typename THasher = HashCoder<TKey>, typename TEqualComparer = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
◆ erase_if
template<typename TKey , typename TMapped , typename THasher = HashCoder<TKey>, typename TEqualComparer = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
template<typename ValueFilter >
size_type erase_if |
( |
unordered_map_open< TKey, TMapped, THasher, TEqualComparer, TAllocator > & |
cont, |
|
|
const ValueFilter & |
valueFilter |
|
) |
| |
|
friend |
◆ swap
template<typename TKey , typename TMapped , typename THasher = HashCoder<TKey>, typename TEqualComparer = std::equal_to<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
The documentation for this class was generated from the following file: