template<typename TKey, typename TMapped, typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
class momo::stdish::multimap< TKey, TMapped, TLessComparer, TAllocator, TTreeMap >
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:
- 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 TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename... ValueArgs>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename ValueArg = std::pair<key_type, mapped_type>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename Iterator >
| void momo::stdish::multimap< TKey, TMapped, TLessComparer, TAllocator, TTreeMap >::insert |
( |
Iterator |
first, |
|
|
Iterator |
last |
|
) |
| |
|
inline |
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename ValueArg = std::pair<key_type, mapped_type>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
template<typename ValueFilter >
| size_type erase_if |
( |
multimap< TKey, TMapped, TLessComparer, TAllocator, TTreeMap > & |
cont, |
|
|
const ValueFilter & |
valueFilter |
|
) |
| |
|
friend |
template<typename TKey , typename TMapped , typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessComparer, true>, MemManagerStd<TAllocator>>>
| void swap |
( |
multimap< TKey, TMapped, TLessComparer, TAllocator, TTreeMap > & |
left, |
|
|
multimap< TKey, TMapped, TLessComparer, TAllocator, TTreeMap > & |
right |
|
) |
| |
|
friend |