template<typename TKey, typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
class momo::stdish::multiset< TKey, TLessFunc, TAllocator, TTreeSet >
momo::stdish::multiset
is similar to std::multiset
, 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.
- Functions
begin
, cbegin
, rend
and crend
have logarithmic complexity.
- If
ObjectManager<key_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 TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
template<typename... ValueArgs>
template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
template<typename Iterator >
void momo::stdish::set< TKey, TLessFunc, TAllocator, TTreeSet >::insert |
( |
typename Iterator |
| ) |
|
|
inline |
template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
template<typename ValueFilter >
size_type erase_if |
( |
multiset< TKey, TLessFunc, TAllocator, TTreeSet > & |
cont, |
|
|
const ValueFilter & |
valueFilter |
|
) |
| |
|
friend |
template<typename TKey , typename TLessFunc = std::less<TKey>, typename TAllocator = std::allocator<TKey>, typename TTreeSet = TreeSet<TKey, TreeTraitsStd<TKey, TLessFunc, true>, MemManagerStd<TAllocator>>>
void swap |
( |
multiset< TKey, TLessFunc, TAllocator, TTreeSet > & |
left, |
|
|
multiset< TKey, TLessFunc, TAllocator, TTreeSet > & |
right |
|
) |
| |
|
friend |