mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Update unordered_multiset synopsis to be modelled after the standard
This commit is contained in:
@ -7,261 +7,186 @@
|
||||
|
||||
=== Synopsis
|
||||
|
||||
[source,c++,subs=+quotes]
|
||||
[listing,subs="+macros,+quotes"]
|
||||
-----
|
||||
// #include <boost/unordered_set.hpp>
|
||||
|
||||
template<
|
||||
typename Value,
|
||||
typename Hash = boost::hash<Value>,
|
||||
typename Pred = std::equal_to<Value>,
|
||||
typename Alloc = std::allocator<std::pair<Value const, Mapped>> >
|
||||
class unordered_multiset {
|
||||
public:
|
||||
// types
|
||||
typedef Value key_type;
|
||||
typedef Value value_type;
|
||||
typedef Hash hasher;
|
||||
typedef Pred key_equal;
|
||||
typedef Alloc allocator_type;
|
||||
typedef typename allocator_type::pointer pointer;
|
||||
typedef typename allocator_type::const_pointer const_pointer;
|
||||
typedef value_type& reference;
|
||||
typedef value_type const& const_reference;
|
||||
typedef _implementation-defined_ size_type;
|
||||
typedef _implementation-defined_ difference_type;
|
||||
typedef _implementation-defined_ iterator;
|
||||
typedef _implementation-defined_ const_iterator;
|
||||
typedef _implementation-defined_ local_iterator;
|
||||
typedef _implementation-defined_ const_local_iterator;
|
||||
typedef _implementation-defined_ node_type;
|
||||
typedef _implementation-defined_ insert_return_type;
|
||||
namespace boost {
|
||||
template<class Key,
|
||||
class Hash = boost::hash<Key>,
|
||||
class Pred = std::equal_to<Key>,
|
||||
class Allocator = std::allocator<Key>>
|
||||
class unordered_multiset {
|
||||
public:
|
||||
// types
|
||||
using key_type = Key;
|
||||
using value_type = Key;
|
||||
using hasher = Hash;
|
||||
using key_equal = Pred;
|
||||
using allocator_type = Allocator;
|
||||
using pointer = typename boost::allocator_traits<Allocator>::pointer;
|
||||
using const_pointer = typename boost::allocator_traits<Allocator>::const_pointer;
|
||||
using reference = value_type&;
|
||||
using const_reference = const value_type&;
|
||||
using size_type = _implementation-defined_;
|
||||
using difference_type = _implementation-defined_;
|
||||
|
||||
// construct/copy/destruct
|
||||
unordered_multiset();
|
||||
using iterator = _implementation-defined_;
|
||||
using const_iterator = _implementation-defined_;
|
||||
using local_iterator = _implementation-defined_;
|
||||
using const_local_iterator = _implementation-defined_;
|
||||
using node_type = _implementation-defined_;
|
||||
|
||||
explicit unordered_multiset(size_type n,
|
||||
hasher const& hf = hasher(),
|
||||
key_equal const& eq = key_equal(),
|
||||
allocator_type const& a = allocator_type());
|
||||
// construct/copy/destroy
|
||||
xref:#unordered_multiset_default_constructor[unordered_multiset]();
|
||||
explicit xref:#unordered_multiset_bucket_count_constructor[unordered_multiset](size_type n,
|
||||
const hasher& hf = hasher(),
|
||||
const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
template<class InputIterator>
|
||||
xref:#unordered_multiset_iterator_range_constructor[unordered_multiset](InputIterator f, InputIterator l,
|
||||
size_type n = _implementation-defined_,
|
||||
const hasher& hf = hasher(),
|
||||
const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
xref:#unordered_multiset_copy_constructor[unordered_multiset](const unordered_multiset& other);
|
||||
xref:#unordered_multiset_move_constructor[unordered_multiset](unordered_multiset&& other);
|
||||
explicit xref:#unordered_multiset_allocator_constructor[unordered_multiset](const Allocator& a);
|
||||
xref:#unordered_multiset_copy_constructor_with_allocator[unordered_multiset](const unordered_multiset& other, const Allocator& a);
|
||||
xref:#unordered_multiset_move_constructor_with_allocator[unordered_multiset](unordered_multiset&& other, const Allocator& a);
|
||||
xref:#unordered_multiset_initializer_list_constructor[unordered_multiset](initializer_list<value_type> il,
|
||||
size_type n = _implementation-defined_,
|
||||
const hasher& hf = hasher(),
|
||||
const key_equal& eql = key_equal(),
|
||||
const allocator_type& a = allocator_type());
|
||||
xref:#unordered_multiset_bucket_count_constructor_with_allocator[unordered_multiset](size_type n, const allocator_type& a);
|
||||
xref:#unordered_multiset_bucket_count_constructor_with_hasher_and_allocator[unordered_multiset](size_type n, const hasher& hf, const allocator_type& a);
|
||||
template<class InputIterator>
|
||||
xref:#unordered_multiset_iterator_range_constructor_with_bucket_count_and_allocator[unordered_multiset](InputIterator f, InputIterator l, size_type n, const allocator_type& a);
|
||||
template<class InputIterator>
|
||||
xref:#unordered_multiset_iterator_range_constructor_with_bucket_count_and_hasher[unordered_multiset](InputIterator f, InputIterator l, size_type n, const hasher& hf,
|
||||
const allocator_type& a);
|
||||
xref:#unordered_multiset_destructor[~unordered_multiset()];
|
||||
unordered_multiset& xref:#unordered_multiset_copy_assignment[operator++=++](const unordered_multiset& other);
|
||||
unordered_multiset& xref:#unordered_multiset_move_assignment[operator++=++](unordered_multiset&& other)
|
||||
noexcept(boost::allocator_traits<Allocator>::is_always_equal::value &&
|
||||
boost::is_nothrow_move_assignable_v<Hash> &&
|
||||
boost::is_nothrow_move_assignable_v<Pred>);
|
||||
unordered_multiset& xref:#unordered_multiset_initializer_list_assignment[operator++=++](initializer_list<value_type> il);
|
||||
allocator_type xref:#unordered_multiset_get_allocator[get_allocator]() const noexcept;
|
||||
|
||||
unordered_multiset(unordered_multiset const& other);
|
||||
unordered_multiset(unordered_multiset&& other);
|
||||
// iterators
|
||||
iterator xref:#unordered_multiset_begin[begin]() noexcept;
|
||||
const_iterator xref:#unordered_multiset_begin[begin]() const noexcept;
|
||||
iterator xref:#unordered_multiset_end[end]() noexcept;
|
||||
const_iterator xref:#unordered_multiset_end[end]() const noexcept;
|
||||
const_iterator xref:#unordered_multiset_cbegin[cbegin]() const noexcept;
|
||||
const_iterator xref:#unordered_multiset_cend[cend]() const noexcept;
|
||||
|
||||
explicit unordered_multiset(Allocator const& a);
|
||||
unordered_multiset(unordered_multiset const& other, Allocator const& a);
|
||||
unordered_multiset(unordered_multiset&& other, Allocator const& a);
|
||||
// capacity
|
||||
bool xref:#unordered_multiset_empty[empty]() const noexcept;
|
||||
size_type xref:#unordered_multiset_size[size]() const noexcept;
|
||||
size_type xref:#unordered_multiset_max_size[max_size]() const noexcept;
|
||||
|
||||
unordered_multiset(size_type n, allocator_type const& a);
|
||||
unordered_multiset(size_type n, hasher const& hf, allocator_type const& a);
|
||||
// modifiers
|
||||
template<class... Args> iterator xref:#unordered_multiset_emplace[emplace](Args&&... args);
|
||||
template<class... Args> iterator xref:#unordered_multiset_emplace_hint[emplace_hint](const_iterator position, Args&&... args);
|
||||
iterator xref:#unordered_multiset_copy_insert[insert](const value_type& obj);
|
||||
iterator xref:#unordered_multiset_move_insert[insert](value_type&& obj);
|
||||
iterator xref:#unordered_multiset_copy_insert_with_hint[insert](const_iterator hint, const value_type& obj);
|
||||
iterator xref:#unordered_multiset_move_insert_with_hint[insert](const_iterator hint, value_type&& obj);
|
||||
template<class InputIterator> void xref:#unordered_multiset_insert_iterator_range[insert](InputIterator first, InputIterator last);
|
||||
void xref:#unordered_multiset_insert_initializer_list[insert](initializer_list<value_type> il);
|
||||
|
||||
unordered_multiset(initializer_list<value_type> il,
|
||||
size_type n = _implementation-defined_,
|
||||
hasher const& hf = hasher(),
|
||||
key_equal const& eq = key_equal(),
|
||||
allocator_type const& a = allocator_type());
|
||||
node_type xref:#unordered_multiset_extract_by_iterator[extract](const_iterator position);
|
||||
node_type xref:#unordered_multiset_extract_by_value[extract](const key_type& k);
|
||||
template<class K> node_type xref:#unordered_multiset_transparent_extract_by_value[extract](K&& k);
|
||||
iterator xref:#unordered_multiset_insert_with_node_handle[insert](node_type&& nh);
|
||||
iterator xref:#unordered_multiset_insert_with_hint_and_node_handle[insert](const_iterator hint, node_type&& nh);
|
||||
|
||||
template<typename InputIterator>
|
||||
unordered_multiset(InputIterator f,
|
||||
InputIterator l,
|
||||
size_type n = _implementation-defined_,
|
||||
hasher const& hf = hasher(),
|
||||
key_equal const& eq = key_equal(),
|
||||
allocator_type const& a = allocator_type());
|
||||
iterator xref:#unordered_multiset_erase_by_position[erase](iterator position);
|
||||
iterator xref:#unordered_multiset_erase_by_position[erase](const_iterator position);
|
||||
size_type xref:#unordered_multiset_erase_by_value[erase](const key_type& k);
|
||||
template<class K> size_type xref:#unordered_multiset_transparent_erase_by_value[erase](K&& x);
|
||||
iterator xref:#unordered_multiset_erase_range[erase](const_iterator first, const_iterator last);
|
||||
void xref:#unordered_multiset_quick_erase[quick_erase](const_iterator position);
|
||||
void xref:#unordered_multiset_erase_return_void[erase_return_void](const_iterator position);
|
||||
void xref:#unordered_multiset_swap[swap](unordered_multiset&)
|
||||
noexcept(boost::allocator_traits<Allocator>::is_always_equal::value &&
|
||||
boost::is_nothrow_swappable_v<Hash> &&
|
||||
boost::is_nothrow_swappable_v<Pred>);
|
||||
void xref:#unordered_multiset_clear[clear]() noexcept;
|
||||
|
||||
template<typename InputIterator>
|
||||
unordered_multiset(InputIterator f,
|
||||
InputIterator l,
|
||||
size_type n,
|
||||
allocator_type const& a);
|
||||
template<class H2, class P2>
|
||||
void xref:#unordered_multiset_merge[merge](unordered_multiset<Key, H2, P2, Allocator>& source);
|
||||
template<class H2, class P2>
|
||||
void xref:#unordered_multiset_merge_rvalue_reference[merge](unordered_multiset<Key, H2, P2, Allocator>&& source);
|
||||
|
||||
template<typename InputIterator>
|
||||
unordered_multiset(InputIterator f,
|
||||
InputIterator l,
|
||||
size_type n,
|
||||
hasher const& hf,
|
||||
allocator_type const& a);
|
||||
// observers
|
||||
hasher xref:#unordered_multiset_hash_function[hash_function]() const;
|
||||
key_equal xref:#unordered_multiset_key_eq[key_eq]() const;
|
||||
|
||||
~unordered_multiset();
|
||||
// set operations
|
||||
iterator xref:#unordered_multiset_find[find](const key_type& k);
|
||||
const_iterator xref:#unordered_multiset_find[find](const key_type& k) const;
|
||||
template<class K>
|
||||
iterator xref:#unordered_multiset_find[find](const K& k);
|
||||
template<class K>
|
||||
const_iterator xref:#unordered_multiset_find[find](const K& k) const;
|
||||
template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate>
|
||||
iterator xref:#unordered_multiset_find[find](CompatibleKey const&, CompatibleHash const&,
|
||||
CompatiblePredicate const&);
|
||||
template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate>
|
||||
const_iterator xref:#unordered_multiset_find[find](CompatibleKey const&, CompatibleHash const&,
|
||||
CompatiblePredicate const&) const;
|
||||
size_type xref:#unordered_multiset_count[count](const key_type& k) const;
|
||||
template<class K>
|
||||
size_type xref:#unordered_multiset_count[count](const K& k) const;
|
||||
bool xref:#unordered_multiset_contains[contains](const key_type& k) const;
|
||||
template<class K>
|
||||
bool xref:#unordered_multiset_contains[contains](const K& k) const;
|
||||
std::pair<iterator, iterator> xref:#unordered_multiset_equal_range[equal_range](const key_type& k);
|
||||
std::pair<const_iterator, const_iterator> xref:#unordered_multiset_equal_range[equal_range](const key_type& k) const;
|
||||
template<class K>
|
||||
std::pair<iterator, iterator> xref:#unordered_multiset_equal_range[equal_range](const K& k);
|
||||
template<class K>
|
||||
std::pair<const_iterator, const_iterator> xref:#unordered_multiset_equal_range[equal_range](const K& k) const;
|
||||
|
||||
unordered_multiset& operator=(unordered_multiset const& other);
|
||||
unordered_multiset& operator=(unordered_multiset&& other);
|
||||
unordered_multiset& operator=(initializer_list<value_type> il);
|
||||
// bucket interface
|
||||
size_type xref:#unordered_multiset_bucket_count[bucket_count]() const noexcept;
|
||||
size_type xref:#unordered_multiset_max_bucket_count[max_bucket_count]() const noexcept;
|
||||
size_type xref:#unordered_multiset_bucket_size[bucket_size](size_type n) const;
|
||||
size_type xref:#unordered_multiset_bucket[bucket](const key_type& k) const;
|
||||
local_iterator xref:#unordered_multiset_begin_2[begin](size_type n);
|
||||
const_local_iterator xref:#unordered_multiset_begin_2[begin](size_type n) const;
|
||||
local_iterator xref:#unordered_multiset_end_2[end](size_type n);
|
||||
const_local_iterator xref:#unordered_multiset_end_2[end](size_type n) const;
|
||||
const_local_iterator xref:#unordered_multiset_cbegin_2[cbegin](size_type n) const;
|
||||
const_local_iterator xref:#unordered_multiset_cend_2[cend](size_type n) const;
|
||||
|
||||
// size and capacity
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type max_size() const;
|
||||
|
||||
// iterators
|
||||
iterator begin();
|
||||
const_iterator begin() const;
|
||||
|
||||
iterator end();
|
||||
const_iterator end() const;
|
||||
|
||||
const_iterator cbegin() const;
|
||||
const_iterator cend() const;
|
||||
|
||||
// modifiers
|
||||
template<typename... Args>
|
||||
iterator
|
||||
emplace(Args&&... args);
|
||||
|
||||
template<typename... Args>
|
||||
iterator
|
||||
emplace_hint(const_iterator hint, Args&&... args);
|
||||
|
||||
iterator
|
||||
insert(value_type const& obj);
|
||||
|
||||
iterator
|
||||
insert(value_type&& obj);
|
||||
|
||||
iterator insert(node_type&& nh);
|
||||
|
||||
iterator insert(const_iterator hint, value_type const& obj);
|
||||
iterator insert(const_iterator hint, value_type&& obj);
|
||||
iterator insert(const_iterator hint, node_type&& nh);
|
||||
|
||||
template<typename InputIterator>
|
||||
void insert(InputIterator first, InputIterator last);
|
||||
|
||||
void insert(initializer_list<value_type> il);
|
||||
|
||||
node_type extract(const_iterator position);
|
||||
node_type extract(key_type const& k);
|
||||
|
||||
template<typename K>
|
||||
node_type extract(K&& k);
|
||||
|
||||
iterator erase(const_iterator position);
|
||||
iterator erase(const_iterator first, const_iterator last);
|
||||
size_type erase(key_type const& k);
|
||||
|
||||
template<typename K>
|
||||
size_type erase(K&& k);
|
||||
|
||||
void quick_erase(const_iterator position);
|
||||
void erase_return_void(const_iterator position);
|
||||
|
||||
void clear();
|
||||
void swap(unordered_multiset& other);
|
||||
|
||||
template<typename H2, typename P2>
|
||||
void merge(unordered_multiset<Value, Mapped, H2, P2, Alloc>& source);
|
||||
|
||||
template<typename H2, typename P2>
|
||||
void merge(unordered_multiset<Value, Mapped, H2, P2, Alloc>&& source);
|
||||
|
||||
// observers
|
||||
allocator_type get_allocator() const;
|
||||
hasher hash_function() const;
|
||||
key_equal key_eq() const;
|
||||
|
||||
// lookup
|
||||
iterator find(key_type const& k);
|
||||
const_iterator find(key_type const& k) const;
|
||||
|
||||
template<typename K>
|
||||
iterator
|
||||
find(K const& k);
|
||||
|
||||
template<typename K>
|
||||
const_iterator
|
||||
find(K const& k) const;
|
||||
|
||||
template<
|
||||
typename CompatibleValue,
|
||||
typename CompatibleHash,
|
||||
typename CompatiblePredicate>
|
||||
iterator
|
||||
find(CompatibleValue const& k,
|
||||
CompatibleHash const& hash,
|
||||
CompatiblePredicate const&) eq;
|
||||
|
||||
template<
|
||||
typename CompatibleValue,
|
||||
typename CompatibleHash,
|
||||
typename CompatiblePredicate>
|
||||
const_iterator
|
||||
find(CompatibleValue const& k,
|
||||
CompatibleHash const& hash,
|
||||
CompatiblePredicate const& eq) const;
|
||||
|
||||
bool contains(key_type const& key) const;
|
||||
|
||||
template<typename K>
|
||||
bool contains(K const& key);
|
||||
|
||||
size_type count(key_type const& k) const;
|
||||
|
||||
template<typename K>
|
||||
size_type count(K const& k) const;
|
||||
|
||||
std::pair<iterator, iterator>
|
||||
equal_range(key_type const& k);
|
||||
|
||||
std::pair<const_iterator, const_iterator>
|
||||
equal_range(key_type const& k) const;
|
||||
|
||||
template<typename K>
|
||||
std::pair<iterator, iterator>
|
||||
equal_range(K const& k);
|
||||
|
||||
template<typename K>
|
||||
std::pair<const_iterator, const_iterator>
|
||||
equal_range(K const& k) const;
|
||||
|
||||
// bucket interface
|
||||
size_type bucket_count() const;
|
||||
size_type max_bucket_count() const;
|
||||
size_type bucket_size(size_type n) const;
|
||||
size_type bucket(key_type const& k) const;
|
||||
|
||||
local_iterator begin(size_type n);
|
||||
const_local_iterator begin(size_type n) const;
|
||||
|
||||
local_iterator end(size_type n);
|
||||
const_local_iterator end(size_type n) const;
|
||||
|
||||
const_local_iterator cbegin(size_type n) const;
|
||||
const_local_iterator cend(size_type n) const;
|
||||
|
||||
// hash policy
|
||||
float load_factor() const;
|
||||
float max_load_factor() const;
|
||||
|
||||
void max_load_factor(float z);
|
||||
|
||||
void rehash(size_type n);
|
||||
void reserve(size_type n);
|
||||
};
|
||||
// hash policy
|
||||
float xref:#unordered_multiset_load_factor[load_factor]() const noexcept;
|
||||
float xref:#unordered_multiset_max_load_factor[max_load_factor]() const noexcept;
|
||||
void xref:#unordered_multiset_set_max_load_factor[max_load_factor](float z);
|
||||
void xref:#unordered_multiset_rehash[rehash](size_type n);
|
||||
void xref:#unordered_multiset_reserve[reserve](size_type n);
|
||||
};
|
||||
}
|
||||
|
||||
// Equality Comparisons
|
||||
template<
|
||||
typename Value,
|
||||
typename Mapped,
|
||||
typename Hash,
|
||||
typename Pred,
|
||||
typename Alloc>
|
||||
bool operator==(unordered_multiset<Value, Mapped, Hash, Pred, Alloc> const& x,
|
||||
unordered_multiset<Value, Mapped, Hash, Pred, Alloc> const& y);
|
||||
template<class Key, class Hash, class Pred, class Alloc>
|
||||
bool xref:#unordered_multiset_operator[operator++==++](const unordered_multiset<Key, Hash, Pred, Alloc>& x,
|
||||
const unordered_multiset<Key, Hash, Pred, Alloc>& y);
|
||||
|
||||
template<
|
||||
typename Value,
|
||||
typename Mapped,
|
||||
typename Hash,
|
||||
typename Pred,
|
||||
typename Alloc>
|
||||
bool operator!=(unordered_multiset<Value, Mapped, Hash, Pred, Alloc> const& x,
|
||||
unordered_multiset<Value, Mapped, Hash, Pred, Alloc> const& y);
|
||||
template<class Key, class Hash, class Pred, class Alloc>
|
||||
bool xref:#unordered_multiset_operator_2[operator!=](const unordered_multiset<Key, Hash, Pred, Alloc>& x,
|
||||
const unordered_multiset<Key, Hash, Pred, Alloc>& y);
|
||||
|
||||
// swap
|
||||
template<typename Value, typename Mapped, typename Hash, typename Pred,
|
||||
typename Alloc>
|
||||
void swap(unordered_multiset<Value, Mapped, Hash, Pred, Alloc>& x,
|
||||
unordered_multiset<Value, Mapped, Hash, Pred, Alloc>& y);
|
||||
template<class Key, class Hash, class Pred, class Alloc>
|
||||
void xref:#unordered_multiset_swap_2[swap](unordered_multiset<Key, Hash, Pred, Alloc>& x,
|
||||
unordered_multiset<Key, Hash, Pred, Alloc>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
-----
|
||||
|
||||
---
|
||||
|
Reference in New Issue
Block a user