Pigweed
C/C++ API Reference
|
Classes | |
class | const_iterator |
class | iterator |
Public Types | |
using | Item = typename Tree::Item |
IntrusiveMultiSet items must derive from Item . | |
using | key_type = T |
using | value_type = T |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
using | key_compare = Compare |
using | value_compare = Compare |
using | reference = value_type & |
using | const_reference = const value_type & |
using | pointer = value_type * |
using | const_pointer = const value_type * |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
Public Member Functions | |
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 |
Friends | |
template<typename > | |
class | IntrusiveSet |
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.
iterator
s and not const_iterator
s:T | Type of items stored in the set. |
|
inlineexplicitconstexpr |
Constructs an empty set of items.
SFINAE is used to disambiguate between this constructor and the one that takes an initializer list.
Compare | Function with the signature bool(T, T) that is used to order items. |
|
inline |
Constructs an IntrusiveMultiSet from an iterator over Items.
The iterator may dereference as either Item& (e.g. from std::array<Item>) or Item* (e.g. from std::initializer_list<Item*>).
|
inline |
Constructs an IntrusiveMultiSet from a std::initializer_list of pointers to items.
|
inline |
Removes all items from the multiset and leaves it empty.
The items themselves are not destructed.
|
inline |
Returns a pair of iterators where the first points to the item with the smallest key that is not less than the given key, and the second points to the item with the smallest key that is greater than the given key.
|
inline |
Removes an item from the multiset and returns an iterator to the item after the removed item.
The items themselves are not destructed.
|
inline |
Returns a pointer to an item with the given key, or null if the multimap does not contain such an item.
|
inline |
Returns an iterator to the item in the multimap with the smallest key that is greater than or equal to the given key, or end()
if the multimap is empty.
|
inlineconstexprnoexcept |
Returns how many items can be added.
As an intrusive container, this is effectively unbounded.
|
inline |
Splices items from the other
set into this one.
The receiving set's Compare
function is used when inserting items.
|
inline |
Returns an iterator to the item in the multimap with the smallest key that is strictly greater than the given key, or end()
if the multimap is empty.