|
constexpr | IntrusiveMultiSet () |
| Constructs an empty set of items.
|
|
template<typename Comparator > |
constexpr | IntrusiveMultiSet (Comparator &&compare) |
|
template<typename Iterator , typename... Functors> |
| IntrusiveMultiSet (Iterator first, Iterator last, Functors &&... functors) |
|
template<typename... Functors> |
| IntrusiveMultiSet (std::initializer_list< T * > items, Functors &&... functors) |
|
iterator | begin () noexcept |
|
const_iterator | begin () const noexcept |
|
const_iterator | cbegin () const noexcept |
|
iterator | end () noexcept |
|
const_iterator | end () const noexcept |
|
const_iterator | cend () const noexcept |
|
reverse_iterator | rbegin () noexcept |
|
const_reverse_iterator | rbegin () const noexcept |
|
const_reverse_iterator | crbegin () const noexcept |
|
reverse_iterator | rend () noexcept |
|
const_reverse_iterator | rend () const noexcept |
|
const_reverse_iterator | crend () const noexcept |
|
bool | empty () const noexcept |
| Returns whether the multiset has zero items or not.
|
|
size_t | size () const |
| Returns the number of items in the multiset.
|
|
constexpr size_t | max_size () const noexcept |
|
void | clear () |
|
iterator | insert (T &item) |
| Adds the given item to the multiset.
|
|
iterator | insert (iterator, T &item) |
|
template<class Iterator > |
void | insert (Iterator first, Iterator last) |
|
void | insert (std::initializer_list< T * > ilist) |
|
iterator | erase (iterator pos) |
|
iterator | erase (iterator first, iterator last) |
|
size_t | erase (const T &item) |
|
void | swap (IntrusiveMultiSet< T > &other) |
| Exchanges this multiset's items with the other multiset's items.
|
|
template<typename MapType > |
void | merge (MapType &other) |
|
size_t | count (const T &item) const |
| Returns the number of items in the multimap with the given key.
|
|
iterator | find (const T &item) |
|
const_iterator | find (const T &item) const |
|
std::pair< iterator, iterator > | equal_range (const T &item) |
|
std::pair< const_iterator, const_iterator > | equal_range (const T &item) const |
|
iterator | lower_bound (const T &item) |
|
const_iterator | lower_bound (const T &item) const |
|
iterator | upper_bound (const T &item) |
|
const_iterator | upper_bound (const T &item) const |
|
template<typename T>
class pw::IntrusiveMultiSet< T >
A std::multiset<Key, Compare>
-like class that uses intrusive items.
Since the set structure is stored in the items themselves, each item must outlive any set it is a part of and must be part of at most one set.
This set does not require unique keys. Multiple equivalent items may be added.
- Since items are not allocated by this class, the following methods have no analogue:
- std::multiset<T>::operator=
- std::multiset<T>::get_allocator
- std::multiset<T>::emplace
- std::multiset<T>::emplace_hint
- Methods corresponding to the following take initializer lists of pointer to items rather than the items themselves:
- std::multiset<T>::(constructor)
- std::multiset<T>::insert
- There are no overloads corresponding to the following methods that take r-value references.:
- std::multiset<T>::insert
- std::multiset<T>::merge
- Since modifying the set modifies the items themselves, methods corresponding to those below only take
iterator
s and not const_iterator
s:
- std::multiset<T>::insert
- std::multiset<T>::erase
- C++23 methods are not (yet) supported.
- Template Parameters
-
T | Type of items stored in the set. |