diff --git a/source/containers.tex b/source/containers.tex index 8e63326dac..866c5f32bd 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -2298,8 +2298,9 @@ \end{itemize} where \tcode{r1} and \tcode{r2} are keys of elements in \tcode{a_tran}, \item \tcode{n} denotes a value of type \tcode{size_type}, -\item \tcode{z} denotes a value of type \tcode{float}, and -\item \tcode{nh} denotes a non-const rvalue of type \tcode{X::node_type}. +\item \tcode{z} denotes a value of type \tcode{float}, +\item \tcode{nh} denotes a non-const rvalue of type \tcode{X::node_type}, and +\item \tcode{hk} and \tcode{hke} denote values of type \tcode{size_t}. \end{itemize} % Local command to index names as members of all unordered containers. @@ -2753,12 +2754,29 @@ & Average case \bigoh{1}, worst case \bigoh{\tcode{b.size()}}. \\ \rowsep % +\tcode{b.find(k, hk)} +& \tcode{iterator}; \br \tcode{const_iterator} for const \tcode{b}. +& \expects \tcode{b.hash_function()(k)} equals \tcode{hk}.\br + \returns an iterator pointing to an element with key equivalent to + \tcode{k}, or \tcode{b.end()} if no such element exists. +& Average case \bigoh{1}, worst case \bigoh{\tcode{b.size()}}. +\\ \rowsep +% \tcode{a_tran.find(ke)} & \tcode{iterator}; \br \tcode{const_iterator} for const \tcode{a_tran}. & \returns An iterator pointing to an element with key equivalent to \tcode{ke}, or \tcode{a_tran.end()} if no such element exists. & Average case \bigoh{1}, - worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid wverfull + worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull +\\ \rowsep +% +\tcode{a_tran.find(ke, hke)} +& \tcode{iterator}; \br \tcode{const_iterator} for const \tcode{a_tran}. +& \expects \tcode{a_tran.hash_function()(ke)} equals \tcode{hke}.\br + \returns an iterator pointing to an element with key equivalent to + \tcode{ke}, or \tcode{a_tran.end()} if no such element exists.% +& Average case \bigoh{1}, + worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull \\ \rowsep % \indexunordmem{count}% @@ -2768,6 +2786,13 @@ & Average case \bigoh{\tcode{b.count(k)}}, worst case \bigoh{\tcode{b.size()}}. \\ \rowsep % +\tcode{b.count(k, hk)} +& \tcode{size_type} +& \expects \tcode{b.hash_function()(k)} equals \tcode{hk}.\br + \returns the number of elements with key equivalent to \tcode{k}.% +& Average case \bigoh{\tcode{b.count(k)}}, worst case \bigoh{\tcode{b.size()}}. +\\ \rowsep +% \tcode{a_tran.count(ke)} & \tcode{size_type} & \returns The number of elements with key equivalent to \tcode{ke}.% @@ -2776,16 +2801,40 @@ worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull \\ \rowsep % +\tcode{a_tran.count(ke, hke)} +& \tcode{size_type} +& \expects \tcode{b.hash_function()(ke)} equals \tcode{hke}.\br + \returns the number of elements with key equivalent to \tcode{ke}.% +& Average case + \bigoh{\tcode{a_tran.}\br{}\tcode{count(ke)}}, % avoid overfull + worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull +\\ \rowsep +% \indexunordmem{contains}% \tcode{b.contains(k)} & \tcode{bool} -& Equivalent to \tcode{b.find(k) != b.end()}% +& \effects Equivalent to \tcode{b.find(k) != b.end()}% +& Average case \bigoh{1}, worst case \bigoh{\tcode{b.size()}}. +\\ \rowsep +% +\tcode{b.contains(k, hk)} +& \tcode{bool} +& \expects \tcode{b.hash_function()(ke)} equals \tcode{hke}.\br + \effects Equivalent to \tcode{b.find(k) != b.end()}% & Average case \bigoh{1}, worst case \bigoh{\tcode{b.size()}}. \\ \rowsep % \tcode{a_tran.contains(ke)} & \tcode{bool} -& Equivalent to \tcode{a_tran.find(ke) != a_tran.end()}% +& \effects Equivalent to \tcode{a_tran.find(ke) != a_tran.end()}% +& Average case \bigoh{1}, + worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull +\\ \rowsep +% +\tcode{a_tran.contains(ke, hke)} +& \tcode{bool} +& \expects \tcode{a_tran.hash_function()(ke)} equals \tcode{hke}.\br + \effects Equivalent to \tcode{a_tran.find(ke, hke) != a_tran.end()}% & Average case \bigoh{1}, worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull \\ \rowsep @@ -2801,6 +2850,17 @@ \bigoh{\tcode{b.size()}}. \\ \rowsep % +\tcode{b.equal_range(k, hk)} +& \tcode{pair}; \br + \tcode{pair} for const \tcode{b}. +& \expects \tcode{b.hash_function()(k)} equals \tcode{hk}.\br + \returns a range containing all elements with keys equivalent to + \tcode{k}. Returns \tcode{make_pair(b.end(), b.end())} if + no such elements exist.% +& Average case \bigoh{\tcode{b.count(k)}}. Worst case + \bigoh{\tcode{b.size()}}. +\\ \rowsep +% \tcode{a_tran.equal_range(ke)} & \tcode{pair}; \br \tcode{pair} for const \tcode{a_tran}. @@ -2811,6 +2871,18 @@ \bigoh{\tcode{a_tran.}\br{}\tcode{count(ke)}}. % avoid overfull Worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull \\ \rowsep +% +\tcode{a_tran.equal_range(ke, hke)} +& \tcode{pair}; \br + \tcode{pair} for const \tcode{a_tran}. +& \expects \tcode{a_tran.hash_function()(ke)} equals \tcode{hke}.\br + \returns a range containing all elements with keys equivalent to + \tcode{ke}. Returns \tcode{make_pair(a_tran.end(), a_tran.end())} if + no such elements exist.% +& Average case + \bigoh{\tcode{a_tran.}\br{}\tcode{count(ke)}}. % avoid overfull + Worst case \bigoh{\tcode{a_tran.}\br{}\tcode{size()}}. % avoid overfull +\\ \rowsep \indexunordmem{bucket_count}% \tcode{b.bucket_count()} & \tcode{size_type} @@ -7964,22 +8036,40 @@ // map operations iterator find(const key_type& k); const_iterator find(const key_type& k) const; + iterator find(const key_type& k, size_t hash); + const_iterator find(const key_type& k, size_t hash) const; template iterator find(const K& k); template const_iterator find(const K& k) const; + template + iterator find(const K& k, size_t hash); + template + const_iterator find(const K& k, size_t hash) const; size_type count(const key_type& k) const; + size_type count(const key_type& k, size_t hash) const; template size_type count(const K& k) const; + template + size_type count(const K& k, size_t hash) const; bool contains(const key_type& k) const; + bool contains(const key_type& k, size_t hash) const; template bool contains(const K& k) const; + template + bool contains(const K& k, size_t hash) const; pair equal_range(const key_type& k); pair equal_range(const key_type& k) const; + pair equal_range(const key_type& k, size_t hash); + pair equal_range(const key_type& k, size_t hash) const; template pair equal_range(const K& k); template pair equal_range(const K& k) const; + template + pair equal_range(const K& k, size_t hash); + template + pair equal_range(const K& k, size_t hash) const; // \ref{unord.map.elem}, element access mapped_type& operator[](const key_type& k); @@ -8534,22 +8624,40 @@ // map operations iterator find(const key_type& k); const_iterator find(const key_type& k) const; + iterator find(const key_type& k, size_t hash); + const_iterator find(const key_type& k, size_t hash) const; template iterator find(const K& k); template const_iterator find(const K& k) const; + template + iterator find(const K& k, size_t hash); + template + const_iterator find(const K& k, size_t hash) const; size_type count(const key_type& k) const; + size_type count(const key_type& k, size_t hash) const; template size_type count(const K& k) const; + template + size_type count(const K& k, size_t hash) const; bool contains(const key_type& k) const; + bool contains(const key_type& k, size_t hash) const; template bool contains(const K& k) const; + template + bool contains(const K& k, size_t hash) const; pair equal_range(const key_type& k); pair equal_range(const key_type& k) const; + pair equal_range(const key_type& k, size_t hash); + pair equal_range(const key_type& k, size_t hash) const; template pair equal_range(const K& k); template pair equal_range(const K& k) const; + template + pair equal_range(const K& k, size_t hash); + template + pair equal_range(const K& k, size_t hash) const; // bucket interface size_type bucket_count() const noexcept; @@ -8896,22 +9004,40 @@ // set operations iterator find(const key_type& k); const_iterator find(const key_type& k) const; + iterator find(const key_type& k, size_t hash); + const_iterator find(const key_type& k, size_t hash) const; template iterator find(const K& k); template const_iterator find(const K& k) const; + template + iterator find(const K& k, size_t hash); + template + const_iterator find(const K& k, size_t hash) const; size_type count(const key_type& k) const; + size_type count(const key_type& k, size_t hash) const; template size_type count(const K& k) const; + template + size_type count(const K& k, size_t hash) const; bool contains(const key_type& k) const; + bool contains(const key_type& k, size_t hash) const; template bool contains(const K& k) const; + template + bool contains(const K& k, size_t hash) const; pair equal_range(const key_type& k); pair equal_range(const key_type& k) const; + pair equal_range(const key_type& k, size_t hash); + pair equal_range(const key_type& k, size_t hash) const; template pair equal_range(const K& k); template pair equal_range(const K& k) const; + template + pair equal_range(const K& k, size_t hash); + template + pair equal_range(const K& k, size_t hash) const; // bucket interface size_type bucket_count() const noexcept; @@ -9220,22 +9346,40 @@ // set operations iterator find(const key_type& k); const_iterator find(const key_type& k) const; + iterator find(const key_type& k, size_t hash); + const_iterator find(const key_type& k, size_t hash) const; template iterator find(const K& k); template const_iterator find(const K& k) const; + template + iterator find(const K& k, size_t hash); + template + const_iterator find(const K& k, size_t hash) const; size_type count(const key_type& k) const; + size_type count(const key_type& k, size_t hash) const; template size_type count(const K& k) const; + template + size_type count(const K& k, size_t hash) const; bool contains(const key_type& k) const; + bool contains(const key_type& k, size_t hash) const; template bool contains(const K& k) const; + template + bool contains(const K& k, size_t hash) const; pair equal_range(const key_type& k); pair equal_range(const key_type& k) const; + pair equal_range(const key_type& k, size_t hash); + pair equal_range(const key_type& k, size_t hash) const; template pair equal_range(const K& k); template pair equal_range(const K& k) const; + template + pair equal_range(const K& k, size_t hash); + template + pair equal_range(const K& k, size_t hash) const; // bucket interface size_type bucket_count() const noexcept; diff --git a/source/support.tex b/source/support.tex index 0858b1fed9..dec92ca3d0 100644 --- a/source/support.tex +++ b/source/support.tex @@ -598,6 +598,8 @@ \tcode{} \tcode{} \\ \rowsep \defnlibxname{cpp_lib_generic_unordered_lookup} & \tcode{201811L} & \tcode{} \tcode{} \\ \rowsep +\defnlibxname{cpp_lib_generic_unordered_hash_lookup} & \tcode{201902L} & + \tcode{} \tcode{} \\ \rowsep \defnlibxname{cpp_lib_hardware_interference_size} & \tcode{201703L} & \tcode{} \\ \rowsep \defnlibxname{cpp_lib_has_unique_object_representations} & \tcode{201606L} &