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

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

#include <set.h>

Inheritance diagram for momo::stdish::multiset< TKey, TLessComparer, TAllocator >:
momo::stdish::multiset_adaptor< TreeSet< TKey, TreeTraitsStd< TKey, std::less< TKey >, true >, MemManagerStd< std::allocator< TKey > > > > momo::stdish::set_adaptor< TreeSet< TKey, TreeTraitsStd< TKey, std::less< TKey >, true >, MemManagerStd< std::allocator< TKey > > > >

Public Member Functions

multisetoperator= (std::initializer_list< typename MultiSetAdaptor::value_type > values)
 
- Public Member Functions inherited from momo::stdish::multiset_adaptor< TreeSet< TKey, TreeTraitsStd< TKey, std::less< TKey >, true >, MemManagerStd< std::allocator< TKey > > > >
multiset_adaptoroperator= (std::initializer_list< value_type > values)
 
iterator insert (value_type &&value)
 
iterator insert (const value_type &value)
 
iterator insert (node_type &&node)
 
std::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (const_iterator hint, value_type &&value)
 
std::pair< iterator, bool > insert (const value_type &value)
 
iterator insert (const_iterator hint, const value_type &value)
 
insert_return_type insert (node_type &&node)
 
iterator insert (const_iterator hint, node_type &&node)
 
void insert (Iterator first, Iterator last)
 
void insert (std::initializer_list< value_type > values)
 
iterator emplace (ValueArgs &&... valueArgs)
 
- Public Member Functions inherited from momo::stdish::set_adaptor< TreeSet< TKey, TreeTraitsStd< TKey, std::less< TKey >, true >, MemManagerStd< std::allocator< TKey > > > >
 set_adaptor ()
 
 set_adaptor (const allocator_type &alloc)
 
 set_adaptor (const key_compare &lessComp, const allocator_type &alloc=allocator_type())
 
 set_adaptor (Iterator first, Iterator last, const allocator_type &alloc=allocator_type())
 
 set_adaptor (Iterator first, Iterator last, const key_compare &lessComp, const allocator_type &alloc=allocator_type())
 
 set_adaptor (std::initializer_list< value_type > values, const allocator_type &alloc=allocator_type())
 
 set_adaptor (std::initializer_list< value_type > values, const key_compare &lessComp, const allocator_type &alloc=allocator_type())
 
 set_adaptor (set_adaptor &&right)
 
 set_adaptor (set_adaptor &&right, const allocator_type &alloc)
 
 set_adaptor (const set_adaptor &right)
 
 set_adaptor (const set_adaptor &right, const allocator_type &alloc)
 
 ~set_adaptor ()=default
 
set_adaptoroperator= (set_adaptor &&right) noexcept(momo::internal::ContainerAssignerStd::IsNothrowMoveAssignable< set_adaptor >::value)
 
set_adaptoroperator= (const set_adaptor &right)
 
set_adaptoroperator= (std::initializer_list< value_type > values)
 
void swap (set_adaptor &right) noexcept
 
const nested_container_typeget_nested_container () const noexcept
 
nested_container_typeget_nested_container () noexcept
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator rend () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
key_compare key_comp () const
 
value_compare value_comp () const
 
allocator_type get_allocator () const noexcept
 
size_type max_size () const noexcept
 
size_type size () const noexcept
 
MOMO_NODISCARD bool empty () const noexcept
 
void clear () noexcept
 
const_iterator find (const key_type &key) const
 
momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, const_iteratorfind (const KeyArg &key) const
 
size_type count (const key_type &key) const
 
momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, size_typecount (const KeyArg &key) const
 
bool contains (const key_type &key) const
 
momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, bool > contains (const KeyArg &key) const
 
const_iterator lower_bound (const key_type &key) const
 
momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, const_iteratorlower_bound (const KeyArg &key) const
 
const_iterator upper_bound (const key_type &key) const
 
momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, const_iteratorupper_bound (const KeyArg &key) const
 
std::pair< const_iterator, const_iteratorequal_range (const key_type &key) const
 
momo::internal::EnableIf< IsValidKeyArg< KeyArg >::value, std::pair< const_iterator, const_iterator > > equal_range (const KeyArg &key) const
 
std::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (const_iterator hint, value_type &&value)
 
std::pair< iterator, bool > insert (const value_type &value)
 
iterator insert (const_iterator hint, const value_type &value)
 
insert_return_type insert (node_type &&node)
 
iterator insert (const_iterator hint, node_type &&node)
 
void insert (Iterator first, Iterator last)
 
void insert (std::initializer_list< value_type > values)
 
std::pair< iterator, bool > emplace (ValueArgs &&... valueArgs)
 
momo::internal::EnableIf< std::is_same< key_type, typename std::decay< ValueArg >::type >::value, std::pair< iterator, bool > > emplace (ValueArg &&valueArg)
 
iterator emplace_hint (const_iterator hint, ValueArgs &&... valueArgs)
 
momo::internal::EnableIf< std::is_same< key_type, typename std::decay< ValueArg >::type >::value, iteratoremplace_hint (const_iterator hint, ValueArg &&valueArg)
 
iterator erase (const_iterator where)
 
iterator erase (const_iterator first, const_iterator last)
 
size_type erase (const key_type &key)
 
node_type extract (const_iterator where)
 
node_type extract (const key_type &key)
 
void merge (Set &&set_adaptor)
 

Friends

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

Additional Inherited Members

- Public Types inherited from momo::stdish::multiset_adaptor< TreeSet< TKey, TreeTraitsStd< TKey, std::less< TKey >, true >, MemManagerStd< std::allocator< TKey > > > >
typedef iterator insert_return_type
 
typedef key_type value_type
 
typedef TreeSet::Iterator iterator
 
typedef internal::set_node_handle< typename TreeSet::ExtractedItemnode_type
 
- Public Types inherited from momo::stdish::set_adaptor< TreeSet< TKey, TreeTraitsStd< TKey, std::less< TKey >, true >, MemManagerStd< std::allocator< TKey > > > >
typedef TreeSet::Key key_type
 
typedef TreeTraits::LessComparer key_compare
 
typedef TreeSet nested_container_type
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef key_type value_type
 
typedef key_compare value_compare
 
typedef std::allocator_traits< typename MemManager::ByteAllocator >::template rebind_alloc< value_typeallocator_type
 
typedef TreeSet::ConstIterator const_iterator
 
typedef TreeSet::Iterator iterator
 
typedef value_typereference
 
typedef const_iterator::Reference const_reference
 
typedef value_typepointer
 
typedef const_iterator::Pointer const_pointer
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef internal::set_node_handle< typename TreeSet::ExtractedItemnode_type
 
typedef internal::insert_return_type< iterator, node_typeinsert_return_type
 

Detailed Description

template<typename TKey, typename TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<TKey>>
class momo::stdish::multiset< TKey, TLessComparer, TAllocator >

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:

  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. Functions begin, cbegin, rend and crend have logarithmic complexity.
  4. If ObjectManager<key_type>::isNothrowAnywayAssignable is false, functions erase can throw exceptions.
  5. 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 TLessComparer = std::less<TKey>, typename TAllocator = std::allocator<TKey>>
multiset& momo::stdish::multiset< TKey, TLessComparer, TAllocator >::operator= ( std::initializer_list< typename MultiSetAdaptor::value_type values)
inline

Friends And Related Function Documentation

◆ swap

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

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