momo  3.12
momo::stdish::multimap< TKey, TMapped, TLessComparer, TAllocator > Class Template Reference

momo::stdish::multimap is similar to std::multimap, but much more efficient in memory usage. The implementation is based on a B-tree. More...

#include <map.h>

Inheritance diagram for momo::stdish::multimap< TKey, TMapped, TLessComparer, TAllocator >:

Public Member Functions

multimapoperator= (std::initializer_list< typename MultiMapAdaptor::value_type > values)
 

Friends

void swap (multimap &left, multimap &right) noexcept
 

Detailed Description

template<typename TKey, typename TMapped, typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
class momo::stdish::multimap< TKey, TMapped, TLessComparer, TAllocator >

momo::stdish::multimap is similar to std::multimap, but much more efficient in memory usage. The implementation is based on a B-tree.

Deviations from standard class:

  1. Container items must be movable (preferably without exceptions) or copyable, similar to items of std::vector.
  2. After each addition or removal of the item all iterators and references to items become invalid and should not be used.
  3. 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.
  4. Functions begin, cbegin, rend and crend have logarithmic complexity.
  5. If ObjectManager<key_type>::isNothrowAnywayAssignable is false or ObjectManager<mapped_type>::isNothrowAnywayAssignable is false, functions erase can throw exceptions.
  6. 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.

Member Function Documentation

◆ operator=()

template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
multimap& momo::stdish::multimap< TKey, TMapped, TLessComparer, TAllocator >::operator= ( std::initializer_list< typename MultiMapAdaptor::value_type values)
inline

Friends And Related Function Documentation

◆ swap

template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>>
void swap ( multimap< TKey, TMapped, TLessComparer, TAllocator > &  left,
multimap< TKey, TMapped, TLessComparer, TAllocator > &  right 
)
friend

The documentation for this class was generated from the following file: