|
map & | operator= (std::initializer_list< value_type > values) |
|
TreeMap::ValueReferenceRKey | operator[] (key_type &&key) |
|
TreeMap::ValueReferenceCKey | operator[] (const key_type &key) |
|
const mapped_type & | at (const key_type &key) const |
|
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) |
|
template<typename TKey, typename TMapped, typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
class momo::stdish::map< TKey, TMapped, TLessFunc, TAllocator, TTreeMap >
momo::stdish::map
is similar to std::map
, but much more efficient in memory usage. The implementation is based on a B-tree.
Deviations from standard class:
- 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
begin
, cbegin
, rend
and crend
have logarithmic complexity.
- 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.
Function merge
can work fast, if container types are same and each key from one container is less than each key from other container.
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename MappedArg >
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename MappedArg >
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename MappedArg >
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename MappedArg >
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename... MappedArgs>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename... MappedArgs>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename... MappedArgs>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename... MappedArgs>
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
template<typename ValueFilter >
size_type erase_if |
( |
map< TKey, TMapped, TLessFunc, TAllocator, TTreeMap > & |
cont, |
|
|
const ValueFilter & |
valueFilter |
|
) |
| |
|
friend |
template<typename TKey , typename TMapped , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc>, MemManagerStd<TAllocator>>>
void swap |
( |
map< TKey, TMapped, TLessFunc, TAllocator, TTreeMap > & |
left, |
|
|
map< TKey, TMapped, TLessFunc, TAllocator, TTreeMap > & |
right |
|
) |
| |
|
friend |