|
multimap & | operator= (std::initializer_list< value_type > values) |
|
iterator | 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, iterator > | 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, iterator > | 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) |
|
iterator | 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) |
|
template<typename... ValueArgs> |
iterator | emplace (ValueArgs &&... valueArgs) |
|
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, true>, MemManagerStd<TAllocator>>>
class momo::stdish::multimap< TKey, TMapped, TLessFunc, 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 TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<std::pair<const TKey, TMapped>>, typename TTreeMap = TreeMap<TKey, TMapped, TreeTraitsStd<TKey, TLessFunc, true>, 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, true>, 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, true>, 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, true>, 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, true>, 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, true>, 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, true>, 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, true>, MemManagerStd<TAllocator>>>
template<typename... ValueArgs>
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, true>, MemManagerStd<TAllocator>>>
template<typename First , typename Second >
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, true>, MemManagerStd<TAllocator>>>
template<typename First , typename Second >
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, true>, 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, true>, MemManagerStd<TAllocator>>>
template<typename First , typename Second >
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, true>, 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, true>, MemManagerStd<TAllocator>>>
template<typename Iterator >
void momo::stdish::multimap< TKey, TMapped, TLessFunc, TAllocator, TTreeMap >::insert |
( |
Iterator |
first, |
|
|
Iterator |
last |
|
) |
| |
|
inline |
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, true>, 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, true>, 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, true>, MemManagerStd<TAllocator>>>
template<typename First , typename Second >
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, true>, 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, true>, 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, true>, MemManagerStd<TAllocator>>>
template<typename ValueFilter >
size_type erase_if |
( |
multimap< 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, true>, MemManagerStd<TAllocator>>>
void swap |
( |
multimap< TKey, TMapped, TLessFunc, TAllocator, TTreeMap > & |
left, |
|
|
multimap< TKey, TMapped, TLessFunc, TAllocator, TTreeMap > & |
right |
|
) |
| |
|
friend |