| | | | |
| | | | |
| | | | |
| X::mapped_type ( unordered_map and unordered_multimap only) | | | |
| X::value_type ( unordered_set and unordered_multiset only) | | Preconditions: value_type is Cpp17Erasable from X | |
| X::value_type (unordered_map and unordered_multimap only) | | Preconditions: value_type is Cpp17Erasable from X | |
| | | Preconditions: Hash is a unary function object type such that the expression
hf(k) has type size_t. | |
| | | Preconditions: Pred meets the Cpp17CopyConstructible requirements . Pred is a binary predicate that takes two arguments
of type Key. Pred is an equivalence relation . | |
| | An iterator type whose category, value type,
difference type, and pointer and reference types are the same as
X::iterator's . | A local_iterator object may be used to iterate through a
single bucket, but may not be used to iterate across
buckets . | |
| X::const_local_iterator | An iterator type whose category, value type,
difference type, and pointer and reference types are the same as
X::const_iterator's . | A const_local_iterator object may be used to iterate through a
single bucket, but may not be used to iterate across
buckets . | |
| | a specialization of a node-handle
class template, such that the public nested types are
the same types as the corresponding types in X. | | |
| X(n, hf, eq)X a(n, hf, eq); | | Effects: Constructs an empty container with at least n buckets,
using hf as the hash function and eq as the key
equality predicate . | O(n) |
| | | Preconditions: key_equal meets the Cpp17DefaultConstructible requirements . Effects: Constructs an empty container with at least n buckets,
using hf as the hash function and key_equal() as the key
equality predicate . | O(n) |
| | | Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements . Effects: Constructs an empty container with at least n buckets,
using hasher() as the hash function and key_equal()
as the key equality predicate . | O(n) |
| | | Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements . Effects: Constructs an empty container with an unspecified number of
buckets, using hasher() as the hash function and
key_equal() as the key equality predicate . | |
| X(i, j, n, hf, eq) X a(i, j, n, hf, eq); | | Preconditions: value_type is Cpp17EmplaceConstructible into X from *i. Effects: Constructs an empty container with at least n buckets,
using hf as the hash function and eq as the key
equality predicate, and inserts elements from [ i, j) into it . | Average case O(N) (N is distance(i, j)), worst case
O(N2) |
| X(i, j, n, hf) X a(i, j, n, hf); | | Preconditions: key_equal meets the Cpp17DefaultConstructible requirements . value_type is Cpp17EmplaceConstructible into X from *i. Effects: Constructs an empty container with at least n buckets,
using hf as the hash function and key_equal() as the key
equality predicate, and inserts elements from [ i, j) into it . | Average case O(N) (N is distance(i, j)), worst case
O(N2) |
| | | Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements . value_type is Cpp17EmplaceConstructible into X from *i. Effects: Constructs an empty container with at least n buckets,
using hasher() as the hash function and key_equal()
as the key equality predicate, and inserts elements from [ i, j)
into it . | Average case O(N) (N is distance(i, j)), worst case
O(N2) |
| | | Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements . value_type is Cpp17EmplaceConstructible into X from *i. Effects: Constructs an empty container with an unspecified number of
buckets, using hasher() as the hash function and
key_equal() as the key equality predicate, and inserts elements
from [ i, j) into it . | Average case O(N) (N is distance(i, j)), worst case
O(N2) |
| | | Same as X(il.begin(), il.end()). | Same as X(il.begin(), il.end()). |
| | | Same as X(il.begin(), il.end(), n). | Same as X(il.begin(), il.end(), n). |
| | | Same as X(il.begin(), il.end(), n, hf). | Same as X(il.begin(), il.end(), n, hf). |
| | | Same as X(il.begin(), il.end(), n, hf, eq). | Same as X(il.begin(), il.end(), n, hf, eq). |
| | | In addition to the requirements
of Table 73, copies the
hash function, predicate, and maximum load factor . | Average case linear in b.size(), worst case quadratic . |
| | | Copy assignment operator . In addition to the
requirements of Table 73, copies
the hash function, predicate, and maximum load factor . | Average case linear in b.size(), worst case quadratic . |
| | | Preconditions: value_type is
Cpp17CopyInsertable into X
and Cpp17CopyAssignable. Effects: Assigns the range [ il.begin(), il.end()) into a. All
existing elements of a are either assigned to or destroyed . | |
| | | Returns: b's hash function . | |
| | | Returns: b's key equality predicate . | |
| | | Preconditions: value_type is Cpp17EmplaceConstructible into X from args. Effects: Inserts a value_type object t constructed with
std::forward<Args>(args)... if and only if there is no
element in the container with key equivalent to the key of t. The bool component of the returned
pair is true if and only if the insertion takes place, and the iterator
component of the pair points to the element with key equivalent to the
key of t. | Average case O(1), worst case O(a_uniq.size()). |
| | | Preconditions: value_type is Cpp17EmplaceConstructible into X from args. Effects: Inserts a value_type object t constructed with
std::forward<Args>(args)... and returns the iterator pointing
to the newly inserted element . | Average case O(1), worst case O(a_eq.size()). |
| | | Preconditions: value_type is Cpp17EmplaceConstructible into X from args. Effects: Equivalent to a.emplace( std::forward<Args>(args)...). Return value is an iterator pointing to the element with the key equivalent
to the newly inserted element . The const_iterator p
is a hint pointing to where the search should start . Implementations are
permitted to ignore the hint . | Average case O(1), worst case O(a.size()). |
| | | Preconditions: If t is a non-const rvalue, value_type is
Cpp17MoveInsertable into X; otherwise, value_type is
Cpp17CopyInsertable into X. Effects: Inserts t if and only if there is no element in the container
with key equivalent to the key of t. The bool
component of the returned pair indicates whether the insertion
takes place, and the iterator component points to the element
with key equivalent to the key of t. | Average case O(1), worst case O(a_uniq.size()). |
| | | Preconditions: If t is a non-const rvalue, value_type is
Cpp17MoveInsertable into X; otherwise, value_type is
Cpp17CopyInsertable into X. Effects: Inserts t, and returns an iterator pointing to the newly
inserted element . | Average case O(1), worst case O(a_eq.size()). |
| | | Preconditions: If t is a non-const rvalue, value_type is
Cpp17MoveInsertable into X; otherwise, value_type is
Cpp17CopyInsertable into X. Effects: Equivalent to a.insert(t). Return value is an iterator pointing
to the element with the key equivalent to that of t. The
iterator p is a hint pointing to where the search should
start . Implementations are permitted to ignore the hint . | Average case O(1), worst case O(a.size()). |
| | | Preconditions: value_type is Cpp17EmplaceConstructible into X from *i. Neither i nor j are iterators into a. Effects: Equivalent to a.insert(t) for each element in [i,j). | Average case O(N), where N is distance(i, j),
worst case O(N(a.size()+1)). |
| | | Same as a.insert(il.begin(), il.end()). | Same as a.insert( il.begin(), il.end()). |
| | | Preconditions: nh is empty or
a_uniq.get_allocator() == nh.get_allocator(). Effects: If nh is empty, has no effect . Otherwise, inserts the
element owned by nh if and only if there is no element in the
container with a key equivalent to nh.key(). Postconditions: If nh is empty, inserted is false,
position is end(), and node is empty . Otherwise if the insertion took place, inserted is true,
position points to the inserted element, and node is empty;
if the insertion failed, inserted is false,
node has the previous value of nh, and position
points to an element with a key equivalent to nh.key(). | Average case O(1), worst case O(a_uniq.size()). |
| | | Preconditions: nh is empty or
a_eq.get_allocator() == nh.get_allocator(). Effects: If nh is empty, has no effect and returns a_eq.end(). Otherwise, inserts the element owned by nh and returns an iterator
pointing to the newly inserted element . Postconditions: nh is empty . | Average case O(1), worst case O(a_eq.size()). |
| | | Preconditions: nh is empty or
a.get_allocator() == nh.get_allocator(). Effects: If nh is empty, has no effect and returns a.end(). Otherwise, inserts the element owned by nh if and only if there
is no element with key equivalent to nh.key() in containers with
unique keys; always inserts the element owned by nh in containers
with equivalent keys . Always returns the iterator pointing to the element
with key equivalent to nh.key(). The iterator q is a hint
pointing to where the search should start . Implementations are permitted
to ignore the hint . Postconditions: nh is empty if insertion succeeds, unchanged if insertion fails . | Average case O(1), worst case O(a.size()). |
| | | Effects: Removes an element in the container with key equivalent to k. Returns: A node_type owning the element if found, otherwise an empty
node_type. | Average case O(1), worst case O(a.size()). |
| | | Effects: Removes the element pointed to by q. Returns: A node_type owning that element . | Average case O(1), worst case O(a.size()). |
| | | Preconditions: a.get_allocator() == a2.get_allocator(). Attempts to extract each element in a2 and insert it into a
using the hash function and key equality predicate of a. In containers with unique keys, if there is an element in a with
key equivalent to the key of an element from a2, then that
element is not extracted from a2. Postconditions: Pointers and references to the transferred elements of a2
refer to those same elements but as members of a. Iterators referring
to the transferred elements and all iterators referring to a will
be invalidated, but iterators to elements remaining in a2 will
remain valid . | Average case O(N), where N is a2.size(),
worst case O(N*a.size()+N). |
| | | Effects: Erases all elements with key equivalent to k. Returns: The number of elements erased . | Average case O(a.count(k)), worst case
O(a.size()). |
| | | Effects: Erases the element pointed to by q. Returns: The iterator immediately following q prior to the erasure . | Average case O(1), worst case O(a.size()). |
| | | Effects: Erases the element pointed to by r. Returns: The iterator immediately following r prior to the erasure . | Average case O(1), worst case O(a.size()). |
| | | Effects: Erases all elements in the range [q1, q2). Returns: The iterator immediately following the erased elements prior to the
erasure . | Average case linear in distance(q1, q2),
worst case O(a.size()). |
| | | Effects: Erases all elements in the container . Postconditions: a.empty() is true
| |
| | iterator; const_iterator for const b. | Returns: An iterator pointing to an element with key equivalent to
k, or b.end() if no such element exists . | Average case O(1), worst case O(b.size()). |
| | iterator; const_iterator for const a_tran. | Returns: An iterator pointing to an element with key equivalent to
ke, or a_tran.end() if no such element exists . | Average case O(1),
worst case O(a_tran.size()). |
| | | Returns: The number of elements with key equivalent to k. | Average case O(b.count(k)), worst case O(b.size()). |
| | | Returns: The number of elements with key equivalent to ke. | Average case
O(a_tran.count(ke)), worst case O(a_tran.size()). |
| | | Effects: Equivalent to b.find(k) != b.end() | Average case O(1), worst case O(b.size()). |
| | | Effects: Equivalent to a_tran.find(ke) != a_tran.end() | Average case O(1),
worst case O(a_tran.size()). |
| | pair<iterator, iterator>; pair<const_iterator, const_iterator> for const b. | Returns: A range containing all elements with keys equivalent to
k. Returns make_pair(b.end(), b.end()) if
no such elements exist . | Average case O(b.count(k)), worst case
O(b.size()). |
| | pair<iterator, iterator>; pair<const_iterator, const_iterator> for const a_tran. | Returns: A range containing all elements with keys equivalent to
ke. Returns make_pair(a_tran.end(), a_tran.end()) if
no such elements exist . | Average case
O(a_tran.count(ke)), worst case O(a_tran.size()). |
| | | Returns: The number of buckets that b contains . | |
| | | Returns: An upper bound on the number of buckets that b can
ever contain . | |
| | | Preconditions: b.bucket_count() > 0. Returns: The index of the bucket in which elements with keys equivalent
to k would be found, if any such element existed . Postconditions: The return value shall be in the range [0, b.bucket_count()). | |
| | | Preconditions: n shall be in the range [0, b.bucket_count()). Returns: The number of elements in the nth bucket . | O(b.bucket_size(n)) |
| | local_iterator; const_local_iterator for const b. | Preconditions: n is in the range [0, b.bucket_count()). Returns: An iterator referring to the
first element in the bucket . If the bucket is empty, then
b.begin(n) == b.end(n). | |
| | local_iterator; const_local_iterator for const b. | Preconditions: n is in the range [0, b.bucket_count()). Returns: An iterator which is the past-the-end
value for the bucket . | |
| | | Preconditions: n shall be in the range [0, b.bucket_count()). Returns: An iterator referring to the
first element in the bucket . If the bucket is empty, then
b.cbegin(n) == b.cend(n). | |
| | | Preconditions: n is in the range [0, b.bucket_count()). Returns: An iterator which is the past-the-end
value for the bucket . | |
| | | Returns: The average number of elements per bucket . | |
| | | Returns: A positive number that the container attempts to keep the load factor
less than or equal to . The container automatically increases the
number of buckets as necessary to keep the load factor below this
number . | |
| | | Preconditions: z is positive . May change the container's maximum load factor, using z as a hint . | |
| | | Postconditions: a.bucket_count() >= a.size() / a.max_load_factor() and
a.bucket_count() >= n. | Average case linear in a.size(), worst case quadratic . |
| | | Same as a.rehash(ceil(n / a.max_load_factor())). | Average case linear in a.size(), worst case quadratic . |