From ce2f9fd8ac8ac86236e37e63b53ab44ff5b79034 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 29 Oct 2017 12:45:11 +0000 Subject: [PATCH] Tweak some of the consistent ids in boostbook They use '.' as a separator which results in paths like 'as_fe_id-1/3/2/6/2/7/1/1/1.html'. --- test/more/tests/libs/array.gold2 | 148 ++-- test/more/tests/libs/hash-ref.gold2 | 324 ++++---- test/more/tests/libs/unordered-ref.gold2 | 972 +++++++++++------------ test/more/tests/ref/methodname.gold2 | 14 +- xsl/lookup.xsl | 17 +- 5 files changed, 744 insertions(+), 731 deletions(-) diff --git a/test/more/tests/libs/array.gold2 b/test/more/tests/libs/array.gold2 index 404f73b..0d0fb5e 100644 --- a/test/more/tests/libs/array.gold2 +++ b/test/more/tests/libs/array.gold2 @@ -65,15 +65,15 @@ No constructors are provided. Elements may have an undetermined initial value (see ). swap() has no constant complexity. - size() is always constant, based on the second template argument of the type. + size() is always constant, based on the second template argument of the type. The container provides no allocator support. It doesn't fulfill the requirements of a "sequence" (see Section 23.1.1, [lib.sequence.reqmts] of the C++ Standard), except that: - front() and back() are provided. - operator[] and at() are provided. + front() and back() are provided. + operator[] and at() are provided. @@ -87,13 +87,13 @@ template<typename T, std::size_t N> bool operator!=(const array<T, N>&, const array<T, N>&); template<typename T, std::size_t N> - bool operator<(const array<T, N>&, const array<T, N>&); + bool operator<(const array<T, N>&, const array<T, N>&); template<typename T, std::size_t N> - bool operator>(const array<T, N>&, const array<T, N>&); + bool operator>(const array<T, N>&, const array<T, N>&); template<typename T, std::size_t N> - bool operator<=(const array<T, N>&, const array<T, N>&); + bool operator<=(const array<T, N>&, const array<T, N>&); template<typename T, std::size_t N> - bool operator>=(const array<T, N>&, const array<T, N>&); + bool operator>=(const array<T, N>&, const array<T, N>&); } Class template array3boost::arraySTL compliant container wrapper for arrays of constant size// In header: <boost/array.hpp> @@ -115,121 +115,121 @@ static const size_type static_size = N; // construct/copy/destruct - template<typename U> array& operator=(const array<U, N>&); + template<typename U> array& operator=(const array<U, N>&); - // iterator support - iterator begin(); - const_iterator begin() const; - iterator end(); - const_iterator end() const; + // iterator support + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; - // reverse iterator support - reverse_iterator rbegin(); - const_reverse_iterator rbegin() const; - reverse_iterator rend(); - const_reverse_iterator rend() const; + // reverse iterator support + reverse_iterator rbegin(); + const_reverse_iterator rbegin() const; + reverse_iterator rend(); + const_reverse_iterator rend() const; - // capacity - size_type size(); - bool empty(); - size_type max_size(); + // capacity + size_type size(); + bool empty(); + size_type max_size(); - // element access - reference operator[](size_type); - const_reference operator[](size_type) const; - reference at(size_type); - const_reference at(size_type) const; - reference front(); - const_reference front() const; - reference back(); - const_reference back() const; - const T* data() const; - T* c_array(); + // element access + reference operator[](size_type); + const_reference operator[](size_type) const; + reference at(size_type); + const_reference at(size_type) const; + reference front(); + const_reference front() const; + reference back(); + const_reference back() const; + const T* data() const; + T* c_array(); - // modifiers - void swap(array<T, N>&); - void assign(const T&); + // modifiers + void swap(array<T, N>&); + void assign(const T&); // public data members T elems[N]; }; -// specialized algorithms +// specialized algorithms template<typename T, std::size_t N> void swap(array<T, N>&, array<T, N>&); -// comparisons +// comparisons template<typename T, std::size_t N> bool operator==(const array<T, N>&, const array<T, N>&); template<typename T, std::size_t N> bool operator!=(const array<T, N>&, const array<T, N>&); template<typename T, std::size_t N> - bool operator<(const array<T, N>&, const array<T, N>&); + bool operator<(const array<T, N>&, const array<T, N>&); template<typename T, std::size_t N> - bool operator>(const array<T, N>&, const array<T, N>&); + bool operator>(const array<T, N>&, const array<T, N>&); template<typename T, std::size_t N> - bool operator<=(const array<T, N>&, const array<T, N>&); + bool operator<=(const array<T, N>&, const array<T, N>&); template<typename T, std::size_t N> - bool operator>=(const array<T, N>&, const array<T, N>&);Description<anchor id="boost.arrayconstruct-copy-destruct"/><computeroutput>array</computeroutput> + <phrase role="keyword">bool</phrase> <link linkend="boost.array.operator_=_1_4_1_1_1_21_6"><phrase role="keyword">operator</phrase><phrase role="special">>=</phrase></link><phrase role="special">(</phrase><phrase role="keyword">const</phrase> <link linkend="boost.array">array</link><phrase role="special"><</phrase><phrase role="identifier">T</phrase><phrase role="special">,</phrase> <phrase role="identifier">N</phrase><phrase role="special">></phrase><phrase role="special">&</phrase><phrase role="special">,</phrase> <phrase role="keyword">const</phrase> <link linkend="boost.array">array</link><phrase role="special"><</phrase><phrase role="identifier">T</phrase><phrase role="special">,</phrase> <phrase role="identifier">N</phrase><phrase role="special">></phrase><phrase role="special">&</phrase><phrase role="special">)</phrase><phrase role="special">;</phrase></synopsis></refsynopsisdiv><refsect1><title>Description<anchor id="boost.arrayconstruct-copy-destruct"/><computeroutput>array</computeroutput> public - construct/copy/destructtemplate<typename U> array& operator=(const array<U, N>& other);template<typename U> array& operator=(const array<U, N>& other);Effects:std::copy(rhs.begin(),rhs.end(), begin())<anchor id="id-1.4.1.1.1.14-bb"/><computeroutput>array</computeroutput> iterator supportiterator begin(); -const_iterator begin() const;Effects:std::copy(rhs.begin(),rhs.end(), begin())<anchor id="id-1_4_1_1_1_14-bb"/><computeroutput>array</computeroutput> iterator supportiterator begin(); +const_iterator begin() const;Returns:iterator for the first elementThrows:will not throwiterator end(); -const_iterator end() const;Returns:iterator for the first elementThrows:will not throwiterator end(); +const_iterator end() const;Returns:iterator for position after the last elementThrows:will not throw<anchor id="id-1.4.1.1.1.15-bb"/><computeroutput>array</computeroutput> reverse iterator supportreverse_iterator rbegin(); -const_reverse_iterator rbegin() const;Returns:iterator for position after the last elementThrows:will not throw<anchor id="id-1_4_1_1_1_15-bb"/><computeroutput>array</computeroutput> reverse iterator supportreverse_iterator rbegin(); +const_reverse_iterator rbegin() const;Returns:reverse iterator for the first element of reverse iterationreverse_iterator rend(); -const_reverse_iterator rend() const;Returns:reverse iterator for the first element of reverse iterationreverse_iterator rend(); +const_reverse_iterator rend() const;Returns:reverse iterator for position after the last element in reverse iteration<anchor id="id-1.4.1.1.1.16-bb"/><computeroutput>array</computeroutput> capacitysize_type size();Returns:reverse iterator for position after the last element in reverse iteration<anchor id="id-1_4_1_1_1_16-bb"/><computeroutput>array</computeroutput> capacitysize_type size();Returns:Nbool empty();Returns:Nbool empty();Returns:N==0Throws:will not throwsize_type max_size();Returns:N==0Throws:will not throwsize_type max_size();Returns:NThrows:will not throw<anchor id="id-1.4.1.1.1.17-bb"/><computeroutput>array</computeroutput> element accessreference operator[](size_type i); -const_reference operator[](size_type i) const;Returns:NThrows:will not throw<anchor id="id-1_4_1_1_1_17-bb"/><computeroutput>array</computeroutput> element accessreference operator[](size_type i); +const_reference operator[](size_type i) const;Requires:i < NReturns:element with index iThrows:will not throw.reference at(size_type i); -const_reference at(size_type i) const;Requires:i < NReturns:element with index iThrows:will not throw.reference at(size_type i); +const_reference at(size_type i) const;Returns:element with index iThrows:std::range_error if i >= Nreference front(); -const_reference front() const;Returns:element with index iThrows:std::range_error if i >= Nreference front(); +const_reference front() const;Requires:N > 0Returns:the first elementThrows:will not throwreference back(); -const_reference back() const;Requires:N > 0Returns:the first elementThrows:will not throwreference back(); +const_reference back() const;Requires:N > 0Returns:the last elementThrows:will not throwconst T* data() const;Requires:N > 0Returns:the last elementThrows:will not throwconst T* data() const;Returns:elemsThrows:will not throwT* c_array();Returns:elemsThrows:will not throwT* c_array();Returns:elemsThrows:will not throw<anchor id="id-1.4.1.1.1.18-bb"/><computeroutput>array</computeroutput> modifiersvoid swap(array<T, N>& other);Returns:elemsThrows:will not throw<anchor id="id-1_4_1_1_1_18-bb"/><computeroutput>array</computeroutput> modifiersvoid swap(array<T, N>& other);Effects:std::swap_ranges(begin(), end(), other.begin())Complexity:linear in Nvoid assign(const T& value);Effects:std::swap_ranges(begin(), end(), other.begin())Complexity:linear in Nvoid assign(const T& value);Effects:std::fill_n(begin(), N, value)<anchor id="id-1.4.1.1.1.20-bb"/><computeroutput>array</computeroutput> specialized algorithmstemplate<typename T, std::size_t N> void swap(array<T, N>& x, array<T, N>& y);Effects:std::fill_n(begin(), N, value)<anchor id="id-1_4_1_1_1_20-bb"/><computeroutput>array</computeroutput> specialized algorithmstemplate<typename T, std::size_t N> void swap(array<T, N>& x, array<T, N>& y);Effects:x.swap(y)Throws:will not throw.<anchor id="id-1.4.1.1.1.21-bb"/><computeroutput>array</computeroutput> comparisonstemplate<typename T, std::size_t N> + ?>Effects:x.swap(y)Throws:will not throw.<anchor id="id-1_4_1_1_1_21-bb"/><computeroutput>array</computeroutput> comparisonstemplate<typename T, std::size_t N> bool operator==(const array<T, N>& x, const array<T, N>& y);Returns:std::equal(x.begin(), x.end(), y.begin())template<typename T, std::size_t N> + ?>Returns:std::equal(x.begin(), x.end(), y.begin())template<typename T, std::size_t N> bool operator!=(const array<T, N>& x, const array<T, N>& y);Returns:!(x == y)template<typename T, std::size_t N> - bool operator<(const array<T, N>& x, const array<T, N>& y);bool operator<(const array<T, N>& x, const array<T, N>& y);Returns:std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end())template<typename T, std::size_t N> - bool operator>(const array<T, N>& x, const array<T, N>& y);Returns:std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end())template<typename T, std::size_t N> + bool operator>(const array<T, N>& x, const array<T, N>& y);Returns:y < xtemplate<typename T, std::size_t N> - bool operator<=(const array<T, N>& x, const array<T, N>& y);bool operator<=(const array<T, N>& x, const array<T, N>& y);Returns:!(y < x)template<typename T, std::size_t N> - bool operator>=(const array<T, N>& x, const array<T, N>& y);bool operator>=(const array<T, N>& x, const array<T, N>& y);Returns:!(x < y) diff --git a/test/more/tests/libs/hash-ref.gold2 b/test/more/tests/libs/hash-ref.gold2 index e3a08b4..cbd8e8f 100644 --- a/test/more/tests/libs/hash-ref.gold2 +++ b/test/more/tests/libs/hash-ref.gold2 @@ -13,74 +13,74 @@ namespace boost { template<typename T> struct hash; - template<> struct hash<bool>; - template<> struct hash<char>; - template<> struct hash<signed char>; - template<> struct hash<unsigned char>; - template<> struct hash<wchar_t>; - template<> struct hash<short>; - template<> struct hash<unsigned short>; - template<> struct hash<int>; - template<> struct hash<unsigned int>; - template<> struct hash<long>; - template<> struct hash<unsigned long>; - template<> struct hash<long long>; - template<> struct hash<unsigned long long>; - template<> struct hash<float>; - template<> struct hash<double>; - template<> struct hash<long double>; - template<> struct hash<std::string>; - template<> struct hash<std::wstring>; - template<typename T> struct hash<T*>; + template<> struct hash<bool>; + template<> struct hash<char>; + template<> struct hash<signed char>; + template<> struct hash<unsigned char>; + template<> struct hash<wchar_t>; + template<> struct hash<short>; + template<> struct hash<unsigned short>; + template<> struct hash<int>; + template<> struct hash<unsigned int>; + template<> struct hash<long>; + template<> struct hash<unsigned long>; + template<> struct hash<long long>; + template<> struct hash<unsigned long long>; + template<> struct hash<float>; + template<> struct hash<double>; + template<> struct hash<long double>; + template<> struct hash<std::string>; + template<> struct hash<std::wstring>; + template<typename T> struct hash<T*>; - // Support functions (Boost extension). + // Support functions (Boost extension). template<typename T> void hash_combine(size_t &, T const&); - template<typename It> std::size_t hash_range(It, It); - template<typename It> void hash_range(std::size_t&, It, It); + template<typename It> std::size_t hash_range(It, It); + template<typename It> void hash_range(std::size_t&, It, It); - // Overloadable hash implementation (Boost extension). - std::size_t hash_value(bool); - std::size_t hash_value(char); - std::size_t hash_value(signed char); - std::size_t hash_value(unsigned char); - std::size_t hash_value(wchar_t); - std::size_t hash_value(short); - std::size_t hash_value(unsigned short); - std::size_t hash_value(int); - std::size_t hash_value(unsigned int); - std::size_t hash_value(long); - std::size_t hash_value(unsigned long); - std::size_t hash_value(long long); - std::size_t hash_value(unsigned long long); - std::size_t hash_value(float); - std::size_t hash_value(double); - std::size_t hash_value(long double); - template<typename T> std::size_t hash_value(T* const&); - template<typename T, unsigned N> std::size_t hash_value(T (&val)[N]); - template<typename T, unsigned N> std::size_t hash_value(const T (&val)[N]); + // Overloadable hash implementation (Boost extension). + std::size_t hash_value(bool); + std::size_t hash_value(char); + std::size_t hash_value(signed char); + std::size_t hash_value(unsigned char); + std::size_t hash_value(wchar_t); + std::size_t hash_value(short); + std::size_t hash_value(unsigned short); + std::size_t hash_value(int); + std::size_t hash_value(unsigned int); + std::size_t hash_value(long); + std::size_t hash_value(unsigned long); + std::size_t hash_value(long long); + std::size_t hash_value(unsigned long long); + std::size_t hash_value(float); + std::size_t hash_value(double); + std::size_t hash_value(long double); + template<typename T> std::size_t hash_value(T* const&); + template<typename T, unsigned N> std::size_t hash_value(T (&val)[N]); + template<typename T, unsigned N> std::size_t hash_value(const T (&val)[N]); template<typename Ch, typename A> - std::size_t hash_value(std::basic_string<Ch, std::char_traits<Ch>, A> const&); + std::size_t hash_value(std::basic_string<Ch, std::char_traits<Ch>, A> const&); template<typename A, typename B> - std::size_t hash_value(std::pair<A, B> const&); + std::size_t hash_value(std::pair<A, B> const&); template<typename T, typename A> - std::size_t hash_value(std::vector<T, A> const&); + std::size_t hash_value(std::vector<T, A> const&); template<typename T, typename A> - std::size_t hash_value(std::list<T, A> const&); + std::size_t hash_value(std::list<T, A> const&); template<typename T, typename A> - std::size_t hash_value(std::deque<T, A> const&); + std::size_t hash_value(std::deque<T, A> const&); template<typename K, typename C, typename A> - std::size_t hash_value(std::set<K, C, A> const&); + std::size_t hash_value(std::set<K, C, A> const&); template<typename K, typename C, typename A> - std::size_t hash_value(std::multiset<K, C, A> const&); + std::size_t hash_value(std::multiset<K, C, A> const&); template<typename K, typename T, typename C, typename A> - std::size_t hash_value(std::map<K, T, C, A> const&); + std::size_t hash_value(std::map<K, T, C, A> const&); template<typename K, typename T, typename C, typename A> - std::size_t hash_value(std::multimap<K, T, C, A> const&); - template<typename T> std::size_t hash_value(std::complex<T> const&); + std::size_t hash_value(std::multimap<K, T, C, A> const&); + template<typename T> std::size_t hash_value(std::complex<T> const&); } - <anchor id="id-1.2.2.21-bb"/><computeroutput/> Support functions (Boost extension).template<typename T> void hash_combine(size_t & seed, T const& v); + <anchor id="id-1_2_2_21-bb"/><computeroutput/> Support functions (Boost extension).template<typename T> void hash_combine(size_t & seed, T const& v); Called repeatedly to incrementally create a hash value from several variables. hash_value(T) throws. Strong exception safety, as long as hash_value(T) also has strong exception safety. - template<typename It> std::size_t hash_range(It first, It last); -template<typename It> void hash_range(std::size_t& seed, It first, It last); + template<typename It> std::size_t hash_range(It first, It last); +template<typename It> void hash_range(std::size_t& seed, It first, It last); Calculate the combined hash value of the elements of an iterator range. hash_range(std::size_t&, It, It) has basic exception safety as long as hash_value(std::iterator_traits<It>::value_type) has basic exception safety. - <anchor id="id-1.2.2.22-bb"/><computeroutput/> Overloadable hash implementation (Boost extension).std::size_t hash_value(bool val); -std::size_t hash_value(char val); -std::size_t hash_value(signed char val); -std::size_t hash_value(unsigned char val); -std::size_t hash_value(wchar_t val); -std::size_t hash_value(short val); -std::size_t hash_value(unsigned short val); -std::size_t hash_value(int val); -std::size_t hash_value(unsigned int val); -std::size_t hash_value(long val); -std::size_t hash_value(unsigned long val); -std::size_t hash_value(long long val); -std::size_t hash_value(unsigned long long val); -std::size_t hash_value(float val); -std::size_t hash_value(double val); -std::size_t hash_value(long double val); -template<typename T> std::size_t hash_value(T* const& val); -template<typename T, unsigned N> std::size_t hash_value(T (&val)[N]); -template<typename T, unsigned N> std::size_t hash_value(const T (&val)[N]); + <anchor id="id-1_2_2_22-bb"/><computeroutput/> Overloadable hash implementation (Boost extension).std::size_t hash_value(bool val); +std::size_t hash_value(char val); +std::size_t hash_value(signed char val); +std::size_t hash_value(unsigned char val); +std::size_t hash_value(wchar_t val); +std::size_t hash_value(short val); +std::size_t hash_value(unsigned short val); +std::size_t hash_value(int val); +std::size_t hash_value(unsigned int val); +std::size_t hash_value(long val); +std::size_t hash_value(unsigned long val); +std::size_t hash_value(long long val); +std::size_t hash_value(unsigned long long val); +std::size_t hash_value(float val); +std::size_t hash_value(double val); +std::size_t hash_value(long double val); +template<typename T> std::size_t hash_value(T* const& val); +template<typename T, unsigned N> std::size_t hash_value(T (&val)[N]); +template<typename T, unsigned N> std::size_t hash_value(const T (&val)[N]); template<typename Ch, typename A> - std::size_t hash_value(std::basic_string<Ch, std::char_traits<Ch>, A> const& val); + std::size_t hash_value(std::basic_string<Ch, std::char_traits<Ch>, A> const& val); template<typename A, typename B> - std::size_t hash_value(std::pair<A, B> const& val); + std::size_t hash_value(std::pair<A, B> const& val); template<typename T, typename A> - std::size_t hash_value(std::vector<T, A> const& val); + std::size_t hash_value(std::vector<T, A> const& val); template<typename T, typename A> - std::size_t hash_value(std::list<T, A> const& val); + std::size_t hash_value(std::list<T, A> const& val); template<typename T, typename A> - std::size_t hash_value(std::deque<T, A> const& val); + std::size_t hash_value(std::deque<T, A> const& val); template<typename K, typename C, typename A> - std::size_t hash_value(std::set<K, C, A> const& val); + std::size_t hash_value(std::set<K, C, A> const& val); template<typename K, typename C, typename A> - std::size_t hash_value(std::multiset<K, C, A> const& val); + std::size_t hash_value(std::multiset<K, C, A> const& val); template<typename K, typename T, typename C, typename A> - std::size_t hash_value(std::map<K, T, C, A> const& val); + std::size_t hash_value(std::map<K, T, C, A> const& val); template<typename K, typename T, typename C, typename A> - std::size_t hash_value(std::multimap<K, T, C, A> const& val); -template<typename T> std::size_t hash_value(std::complex<T> const& val); + std::size_t hash_value(std::multimap<K, T, C, A> const& val); +template<typename T> std::size_t hash_value(std::complex<T> const& val); Implementation of the hash function. Generally shouldn't be called directly by users, instead they should use @@ -243,8 +243,8 @@ template<typename T> struct hash : public std::unary_function<T, std::size_t> { - std::size_t operator()(T const&) const; -};Descriptionstd::size_t operator()(T const& val) const;std::size_t operator()(T const&) const; +};Descriptionstd::size_t operator()(T const& val) const;Returns: hash_value(val) @@ -259,138 +259,138 @@ Throws: Only throws if hash_value(T) throws. - Struct hash<bool>3boost::hash<bool>// In header: <boost/functional/hash.hpp> + Struct hash<bool>3boost::hash<bool>// In header: <boost/functional/hash.hpp> -struct hash<bool> { - std::size_t operator()(bool) const; -};Descriptionstd::size_t operator()(bool val) const;struct hash<bool> { + std::size_t operator()(bool) const; +};Descriptionstd::size_t operator()(bool val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<char>3boost::hash<char>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<char>3boost::hash<char>// In header: <boost/functional/hash.hpp> -struct hash<char> { - std::size_t operator()(char) const; -};Descriptionstd::size_t operator()(char val) const;struct hash<char> { + std::size_t operator()(char) const; +};Descriptionstd::size_t operator()(char val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<signed char>3boost::hash<signed char>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<signed char>3boost::hash<signed char>// In header: <boost/functional/hash.hpp> -struct hash<signed char> { - std::size_t operator()(signed char) const; -};Descriptionstd::size_t operator()(signed char val) const;struct hash<signed char> { + std::size_t operator()(signed char) const; +};Descriptionstd::size_t operator()(signed char val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned char>3boost::hash<unsigned char>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned char>3boost::hash<unsigned char>// In header: <boost/functional/hash.hpp> -struct hash<unsigned char> { - std::size_t operator()(unsigned char) const; -};Descriptionstd::size_t operator()(unsigned char val) const;struct hash<unsigned char> { + std::size_t operator()(unsigned char) const; +};Descriptionstd::size_t operator()(unsigned char val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<wchar_t>3boost::hash<wchar_t>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<wchar_t>3boost::hash<wchar_t>// In header: <boost/functional/hash.hpp> -struct hash<wchar_t> { - std::size_t operator()(wchar_t) const; -};Descriptionstd::size_t operator()(wchar_t val) const;struct hash<wchar_t> { + std::size_t operator()(wchar_t) const; +};Descriptionstd::size_t operator()(wchar_t val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<short>3boost::hash<short>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<short>3boost::hash<short>// In header: <boost/functional/hash.hpp> -struct hash<short> { - std::size_t operator()(short) const; -};Descriptionstd::size_t operator()(short val) const;struct hash<short> { + std::size_t operator()(short) const; +};Descriptionstd::size_t operator()(short val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned short>3boost::hash<unsigned short>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned short>3boost::hash<unsigned short>// In header: <boost/functional/hash.hpp> -struct hash<unsigned short> { - std::size_t operator()(unsigned short) const; -};Descriptionstd::size_t operator()(unsigned short val) const;struct hash<unsigned short> { + std::size_t operator()(unsigned short) const; +};Descriptionstd::size_t operator()(unsigned short val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<int>3boost::hash<int>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<int>3boost::hash<int>// In header: <boost/functional/hash.hpp> -struct hash<int> { - std::size_t operator()(int) const; -};Descriptionstd::size_t operator()(int val) const;struct hash<int> { + std::size_t operator()(int) const; +};Descriptionstd::size_t operator()(int val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned int>3boost::hash<unsigned int>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned int>3boost::hash<unsigned int>// In header: <boost/functional/hash.hpp> -struct hash<unsigned int> { - std::size_t operator()(unsigned int) const; -};Descriptionstd::size_t operator()(unsigned int val) const;struct hash<unsigned int> { + std::size_t operator()(unsigned int) const; +};Descriptionstd::size_t operator()(unsigned int val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<long>3boost::hash<long>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<long>3boost::hash<long>// In header: <boost/functional/hash.hpp> -struct hash<long> { - std::size_t operator()(long) const; -};Descriptionstd::size_t operator()(long val) const;struct hash<long> { + std::size_t operator()(long) const; +};Descriptionstd::size_t operator()(long val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned long>3boost::hash<unsigned long>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned long>3boost::hash<unsigned long>// In header: <boost/functional/hash.hpp> -struct hash<unsigned long> { - std::size_t operator()(unsigned long) const; -};Descriptionstd::size_t operator()(unsigned long val) const;struct hash<unsigned long> { + std::size_t operator()(unsigned long) const; +};Descriptionstd::size_t operator()(unsigned long val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<long long>3boost::hash<long long>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<long long>3boost::hash<long long>// In header: <boost/functional/hash.hpp> -struct hash<long long> { - std::size_t operator()(long long) const; -};Descriptionstd::size_t operator()(long long val) const;struct hash<long long> { + std::size_t operator()(long long) const; +};Descriptionstd::size_t operator()(long long val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned long long>3boost::hash<unsigned long long>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<unsigned long long>3boost::hash<unsigned long long>// In header: <boost/functional/hash.hpp> -struct hash<unsigned long long> { - std::size_t operator()(unsigned long long) const; -};Descriptionstd::size_t operator()(unsigned long long val) const;struct hash<unsigned long long> { + std::size_t operator()(unsigned long long) const; +};Descriptionstd::size_t operator()(unsigned long long val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<float>3boost::hash<float>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<float>3boost::hash<float>// In header: <boost/functional/hash.hpp> -struct hash<float> { - std::size_t operator()(float) const; -};Descriptionstd::size_t operator()(float val) const;struct hash<float> { + std::size_t operator()(float) const; +};Descriptionstd::size_t operator()(float val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<double>3boost::hash<double>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<double>3boost::hash<double>// In header: <boost/functional/hash.hpp> -struct hash<double> { - std::size_t operator()(double) const; -};Descriptionstd::size_t operator()(double val) const;struct hash<double> { + std::size_t operator()(double) const; +};Descriptionstd::size_t operator()(double val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<long double>3boost::hash<long double>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<long double>3boost::hash<long double>// In header: <boost/functional/hash.hpp> -struct hash<long double> { - std::size_t operator()(long double) const; -};Descriptionstd::size_t operator()(long double val) const;struct hash<long double> { + std::size_t operator()(long double) const; +};Descriptionstd::size_t operator()(long double val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<std::string>3boost::hash<std::string>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<std::string>3boost::hash<std::string>// In header: <boost/functional/hash.hpp> -struct hash<std::string> { - std::size_t operator()(std::string const&) const; -};Descriptionstd::size_t operator()(std::string const& val) const;struct hash<std::string> { + std::size_t operator()(std::string const&) const; +};Descriptionstd::size_t operator()(std::string const& val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<std::wstring>3boost::hash<std::wstring>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct hash<std::wstring>3boost::hash<std::wstring>// In header: <boost/functional/hash.hpp> -struct hash<std::wstring> { - std::size_t operator()(std::wstring const&) const; -};Descriptionstd::size_t operator()(std::wstring const& val) const;struct hash<std::wstring> { + std::size_t operator()(std::wstring const&) const; +};Descriptionstd::size_t operator()(std::wstring const& val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct template hash<T*>3boost::hash<T*>// In header: <boost/functional/hash.hpp> + ?>Returns:Unspecified in TR1, except that equal arguments yield the same result.hash_value(val) in Boost.Throws:Doesn't throwStruct template hash<T*>3boost::hash<T*>// In header: <boost/functional/hash.hpp> template<typename T> -struct hash<T*> { - std::size_t operator()(T*) const; -};Descriptionstd::size_t operator()(T* val) const;struct hash<T*> { + std::size_t operator()(T*) const; +};Descriptionstd::size_t operator()(T* val) const;Returns:Unspecified in TR1, except that equal arguments yield the same result.Throws:Doesn't throw diff --git a/test/more/tests/libs/unordered-ref.gold2 b/test/more/tests/libs/unordered-ref.gold2 index 0a501a2..72967eb 100644 --- a/test/more/tests/libs/unordered-ref.gold2 +++ b/test/more/tests/libs/unordered-ref.gold2 @@ -55,91 +55,91 @@ typedef implementation-defined const_local_iterator; // construct/copy/destruct - explicit unordered_set(size_type = implementation-defined, + explicit unordered_set(size_type = implementation-defined, hasher const& = hasher(), key_equal const& = key_equal(), allocator_type const& = allocator_type()); template<typename InputIterator> - unordered_set(InputIterator, InputIterator, + unordered_set(InputIterator, InputIterator, size_type = implementation-defined, hasher const& = hasher(), key_equal const& = key_equal(), allocator_type const& = allocator_type()); - unordered_set(unordered_set const&); - unordered_set(unordered_set &&); - explicit unordered_set(Allocator const&); - unordered_set(unordered_set const&, Allocator const&); - ~unordered_set(); - unordered_set& operator=(unordered_set const&); - unordered_set& operator=(unordered_set &&); - allocator_type get_allocator() const; + unordered_set(unordered_set const&); + unordered_set(unordered_set &&); + explicit unordered_set(Allocator const&); + unordered_set(unordered_set const&, Allocator const&); + ~unordered_set(); + unordered_set& operator=(unordered_set const&); + unordered_set& operator=(unordered_set &&); + allocator_type get_allocator() const; - // size and capacity - bool empty() const; - size_type size() const; - size_type max_size() 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; + // 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> std::pair<iterator, bool> emplace(Args&&...); - template<typename... Args> iterator emplace_hint(const_iterator, Args&&...); - std::pair<iterator, bool> insert(value_type const&); - iterator insert(const_iterator, value_type const&); - template<typename InputIterator> void insert(InputIterator, InputIterator); - iterator erase(const_iterator); - size_type erase(key_type const&); - iterator erase(const_iterator, const_iterator); - void quick_erase(const_iterator); - void erase_return_void(const_iterator); - void clear(); - void swap(unordered_set&); + // modifiers + template<typename... Args> std::pair<iterator, bool> emplace(Args&&...); + template<typename... Args> iterator emplace_hint(const_iterator, Args&&...); + std::pair<iterator, bool> insert(value_type const&); + iterator insert(const_iterator, value_type const&); + template<typename InputIterator> void insert(InputIterator, InputIterator); + iterator erase(const_iterator); + size_type erase(key_type const&); + iterator erase(const_iterator, const_iterator); + void quick_erase(const_iterator); + void erase_return_void(const_iterator); + void clear(); + void swap(unordered_set&); - // observers - hasher hash_function() const; - key_equal key_eq() const; + // observers + hasher hash_function() const; + key_equal key_eq() const; - // lookup - iterator find(key_type const&); - const_iterator find(key_type const&) const; + // lookup + iterator find(key_type const&); + const_iterator find(key_type const&) const; template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> - iterator find(CompatibleKey const&, CompatibleHash const&, + iterator find(CompatibleKey const&, CompatibleHash const&, CompatiblePredicate const&); template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> const_iterator - find(CompatibleKey const&, CompatibleHash const&, + find(CompatibleKey const&, CompatibleHash const&, CompatiblePredicate const&) const; - size_type count(key_type const&) const; - std::pair<iterator, iterator> equal_range(key_type const&); - std::pair<const_iterator, const_iterator> equal_range(key_type const&) const; + size_type count(key_type const&) const; + std::pair<iterator, iterator> equal_range(key_type const&); + std::pair<const_iterator, const_iterator> equal_range(key_type const&) const; - // bucket interface - size_type bucket_count() const; - size_type max_bucket_count() const; - size_type bucket_size(size_type) const; - size_type bucket(key_type const&) const; - local_iterator begin(size_type); - const_local_iterator begin(size_type) const; - local_iterator end(size_type); - const_local_iterator end(size_type) const; - const_local_iterator cbegin(size_type) const; - const_local_iterator cend(size_type); + // bucket interface + size_type bucket_count() const; + size_type max_bucket_count() const; + size_type bucket_size(size_type) const; + size_type bucket(key_type const&) const; + local_iterator begin(size_type); + const_local_iterator begin(size_type) const; + local_iterator end(size_type); + const_local_iterator end(size_type) const; + const_local_iterator cbegin(size_type) const; + const_local_iterator cend(size_type); - // hash policy - float load_factor() const; - float max_load_factor() const; - void max_load_factor(float); - void rehash(size_type); + // hash policy + float load_factor() const; + float max_load_factor() const; + void max_load_factor(float); + void rehash(size_type); }; -// Equality Comparisons +// Equality Comparisons template<typename Value, typename Hash, typename Pred, typename Alloc> bool operator==(unordered_set<Value, Hash, Pred, Alloc> const&, unordered_set<Value, Hash, Pred, Alloc> const&); @@ -147,7 +147,7 @@ bool operator!=(unordered_set<Value, Hash, Pred, Alloc> const&, unordered_set<Value, Hash, Pred, Alloc> const&); -// swap +// swap template<typename Value, typename Hash, typename Pred, typename Alloc> void swap(unordered_set<Value, Hash, Pred, Alloc>&, unordered_set<Value, Hash, Pred, Alloc>&);Description @@ -204,32 +204,32 @@ A const_local_iterator object can be used to iterate through a single bucket. <anchor id="boost.unordered_setconstruct-copy-destruct"/><computeroutput>unordered_set</computeroutput> public - construct/copy/destructexplicit unordered_set(size_type n = implementation-defined, + construct/copy/destructexplicit unordered_set(size_type n = implementation-defined, hasher const& hf = hasher(), key_equal const& eq = key_equal(), allocator_type const& a = allocator_type());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0.Postconditions:size() == 0template<typename InputIterator> - unordered_set(InputIterator f, InputIterator l, + ?>Postconditions:size() == 0template<typename InputIterator> + unordered_set(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());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.unordered_set(unordered_set const&);The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.allocator_type const& a = allocator_type());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.unordered_set(unordered_set const&);The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.Requires:value_type is copy constructibleunordered_set(unordered_set &&);The move constructor.Requires:value_type is copy constructibleunordered_set(unordered_set &&);The move constructor.Notes:This is emulated on compilers without rvalue references.Requires: value_type is move constructible. (TODO: This is not actually required in this implementation). - explicit unordered_set(Allocator const& a);Constructs an empty container, using allocator a.unordered_set(unordered_set const& x, Allocator const& a);Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a.~unordered_set();explicit unordered_set(Allocator const& a);Constructs an empty container, using allocator a.unordered_set(unordered_set const& x, Allocator const& a);Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a.~unordered_set();Notes:The destructor is applied to every element, and all memory is deallocatedunordered_set& operator=(unordered_set const&);The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.Notes:The destructor is applied to every element, and all memory is deallocatedunordered_set& operator=(unordered_set const&);The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.Notes: On compilers without rvalue references, there is a single assignment operator with the signature operator=(unordered_set) in order to emulate move semantics. - Requires:value_type is copy constructibleunordered_set& operator=(unordered_set &&);The move assignment operator.Requires:value_type is copy constructibleunordered_set& operator=(unordered_set &&);The move assignment operator.Notes: On compilers without rvalue references, there is a single assignment @@ -238,92 +238,92 @@ Requires: value_type is move constructible. (TODO: This is not actually required in this implementation). - allocator_type get_allocator() const;<anchor id="id-1.1.1.1.29-bb"/><computeroutput>unordered_set</computeroutput> size and capacitybool empty() const;allocator_type get_allocator() const;<anchor id="id-1_1_1_1_29-bb"/><computeroutput>unordered_set</computeroutput> size and capacitybool empty() const;Returns:size() == 0size_type size() const;Returns:size() == 0size_type size() const;Returns:std::distance(begin(), end())size_type max_size() const;Returns:std::distance(begin(), end())size_type max_size() const;Returns:size() of the largest possible container. - <anchor id="id-1.1.1.1.30-bb"/><computeroutput>unordered_set</computeroutput> iteratorsiterator begin(); -const_iterator begin() const;Returns:size() of the largest possible container. + <anchor id="id-1_1_1_1_30-bb"/><computeroutput>unordered_set</computeroutput> iteratorsiterator begin(); +const_iterator begin() const;Returns:An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. - iterator end(); -const_iterator end() const;iterator end(); +const_iterator end() const;Returns:An iterator which refers to the past-the-end value for the container. - const_iterator cbegin() const;const_iterator cbegin() const;Returns:A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. - const_iterator cend() const;const_iterator cend() const;Returns:A constant iterator which refers to the past-the-end value for the container. - <anchor id="id-1.1.1.1.31-bb"/><computeroutput>unordered_set</computeroutput> modifierstemplate<typename... Args> std::pair<iterator, bool> emplace(Args&&... args);Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent value.<anchor id="id-1_1_1_1_31-bb"/><computeroutput>unordered_set</computeroutput> modifierstemplate<typename... Args> std::pair<iterator, bool> emplace(Args&&... args);Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent value.Returns:The bool component of the return type is true if an insert took place.If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support for rvalue references or move semantics.template<typename... Args> - iterator emplace_hint(const_iterator hint, Args&&... args);Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent value.hint is a suggestion to where the element should be inserted.iterator emplace_hint(const_iterator hint, Args&&... args);Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent value.hint is a suggestion to where the element should be inserted.Returns:If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support - for rvalue references or move semantics.std::pair<iterator, bool> insert(value_type const& obj);Inserts obj in the container if and only if there is no element in the container with an equivalent value.std::pair<iterator, bool> insert(value_type const& obj);Inserts obj in the container if and only if there is no element in the container with an equivalent value.Returns:The bool component of the return type is true if an insert took place.If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator insert(const_iterator hint, value_type const& obj);Inserts obj in the container if and only if there is no element in the container with an equivalent value.hint is a suggestion to where the element should be inserted.Returns:The bool component of the return type is true if an insert took place.If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator insert(const_iterator hint, value_type const& obj);Inserts obj in the container if and only if there is no element in the container with an equivalent value.hint is a suggestion to where the element should be inserted.Returns:If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent value.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.template<typename InputIterator> - void insert(InputIterator first, InputIterator last);Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent value.void insert(InputIterator first, InputIterator last);Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent value.Throws:When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator erase(const_iterator position);Erase the element pointed to by position.Throws:When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator erase(const_iterator position);Erase the element pointed to by position.Returns:The iterator following position before the erasure.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: When the number of elements is a lot smaller than the number of buckets this function can be very inefficient as it has to search through empty buckets for the next element, in order to return the iterator. - The method quick_erase is faster, but has yet + The method quick_erase is faster, but has yet to be standardized. - size_type erase(key_type const& k);Erase all elements with key equivalent to k.size_type erase(key_type const& k);Erase all elements with key equivalent to k.Returns:The number of elements erased.Throws:Only throws an exception if it is thrown by hasher or key_equal.iterator erase(const_iterator first, const_iterator last);Erases the elements in the range from first to last.Returns:The number of elements erased.Throws:Only throws an exception if it is thrown by hasher or key_equal.iterator erase(const_iterator first, const_iterator last);Erases the elements in the range from first to last.Returns:The iterator following the erased elements - i.e. last.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.void quick_erase(const_iterator position);Erase the element pointed to by position.Returns:The iterator following the erased elements - i.e. last.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.void quick_erase(const_iterator position);Erase the element pointed to by position.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: - This method is faster than erase as + This method is faster than erase as it doesn't have to find the next element in the container - a potentially costly operation. As it hasn't been standardized, it's likely that this may change in the future. - void erase_return_void(const_iterator position);Erase the element pointed to by position.void erase_return_void(const_iterator position);Erase the element pointed to by position.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: This method is now deprecated, use quick_return instead. Although be warned that as that isn't standardized yet, it could also change. - void clear();Erases all elements in the container.void clear();Erases all elements in the container.Postconditions:size() == 0Throws:Never throws an exception.void swap(unordered_set&);Postconditions:size() == 0Throws:Never throws an exception.void swap(unordered_set&);Throws:If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.Notes:For a discussion of the behavior when allocators aren't equal see - the implementation details.<anchor id="id-1.1.1.1.32-bb"/><computeroutput>unordered_set</computeroutput> observershasher hash_function() const;the implementation details.<anchor id="id-1_1_1_1_32-bb"/><computeroutput>unordered_set</computeroutput> observershasher hash_function() const;Returns:The container's hash function. - key_equal key_eq() const;key_equal key_eq() const;Returns:The container's key equality predicate. - <anchor id="id-1.1.1.1.33-bb"/><computeroutput>unordered_set</computeroutput> lookupiterator find(key_type const& k); -const_iterator find(key_type const& k) const; + <anchor id="id-1_1_1_1_33-bb"/><computeroutput>unordered_set</computeroutput> lookupiterator find(key_type const& k); +const_iterator find(key_type const& k) const; template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> - iterator find(CompatibleKey const& k, CompatibleHash const& hash, + iterator find(CompatibleKey const& k, CompatibleHash const& hash, CompatiblePredicate const& eq); template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> const_iterator - find(CompatibleKey const& k, CompatibleHash const& hash, + find(CompatibleKey const& k, CompatibleHash const& hash, CompatiblePredicate const& eq) const;Returns:An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists.Notes: @@ -331,41 +331,41 @@ allows you to use a compatible hash function and equality predicate for a key of a different type in order to avoid an expensive type cast. In general, its use is not encouraged. - size_type count(key_type const& k) const;size_type count(key_type const& k) const;Returns:The number of elements with key equivalent to k.std::pair<iterator, iterator> equal_range(key_type const& k); -std::pair<const_iterator, const_iterator> equal_range(key_type const& k) const;Returns:The number of elements with key equivalent to k.std::pair<iterator, iterator> equal_range(key_type const& k); +std::pair<const_iterator, const_iterator> equal_range(key_type const& k) const;Returns:A range containing all elements with key equivalent to k. If the container doesn't container any such elements, returns std::make_pair(b.end(),b.end()). - <anchor id="id-1.1.1.1.34-bb"/><computeroutput>unordered_set</computeroutput> bucket interfacesize_type bucket_count() const;<anchor id="id-1_1_1_1_34-bb"/><computeroutput>unordered_set</computeroutput> bucket interfacesize_type bucket_count() const;Returns:The number of buckets.size_type max_bucket_count() const;Returns:The number of buckets.size_type max_bucket_count() const;Returns:An upper bound on the number of buckets.size_type bucket_size(size_type n) const;Returns:An upper bound on the number of buckets.size_type bucket_size(size_type n) const;Requires:n < bucket_count()Returns:The number of elements in bucket n.size_type bucket(key_type const& k) const;Requires:n < bucket_count()Returns:The number of elements in bucket n.size_type bucket(key_type const& k) const;Returns:The index of the bucket which would contain an element with key k.Postconditions:The return value is less than bucket_count()local_iterator begin(size_type n); -const_local_iterator begin(size_type n) const;Returns:The index of the bucket which would contain an element with key k.Postconditions:The return value is less than bucket_count()local_iterator begin(size_type n); +const_local_iterator begin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the first element in the bucket with index n.local_iterator end(size_type n); -const_local_iterator end(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the first element in the bucket with index n.local_iterator end(size_type n); +const_local_iterator end(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the 'one past the end' element in the bucket with index n.const_local_iterator cbegin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the 'one past the end' element in the bucket with index n.const_local_iterator cbegin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the first element in the bucket with index n.const_local_iterator cend(size_type n);Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the first element in the bucket with index n.const_local_iterator cend(size_type n);Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the 'one past the end' element in the bucket with index n.<anchor id="id-1.1.1.1.35-bb"/><computeroutput>unordered_set</computeroutput> hash policyfloat load_factor() const;Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the 'one past the end' element in the bucket with index n.<anchor id="id-1_1_1_1_35-bb"/><computeroutput>unordered_set</computeroutput> hash policyfloat load_factor() const;Returns:The average number of elements per bucket.float max_load_factor() const;Returns:The average number of elements per bucket.float max_load_factor() const;Returns:Returns the current maximum load factor.void max_load_factor(float z);Returns:Returns the current maximum load factor.void max_load_factor(float z);Effects:Changes the container's maximum load factor, using z as a hint.void rehash(size_type n);Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor.Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.Effects:Changes the container's maximum load factor, using z as a hint.void rehash(size_type n);Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor.Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.Throws:The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.<anchor id="id-1.1.1.1.36-bb"/><computeroutput>unordered_set</computeroutput> Equality Comparisonstemplate<typename Value, typename Hash, typename Pred, typename Alloc> + ?>Throws:The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.<anchor id="id-1_1_1_1_36-bb"/><computeroutput>unordered_set</computeroutput> Equality Comparisonstemplate<typename Value, typename Hash, typename Pred, typename Alloc> bool operator==(unordered_set<Value, Hash, Pred, Alloc> const& x, unordered_set<Value, Hash, Pred, Alloc> const& y);unordered_set<Value, Hash, Pred, Alloc> const& y);Notes:This is a boost extension.Behavior is undefined if the two containers don't have - equivalent equality predicates.<anchor id="id-1.1.1.1.37-bb"/><computeroutput>unordered_set</computeroutput> swaptemplate<typename Value, typename Hash, typename Pred, typename Alloc> + equivalent equality predicates.<anchor id="id-1_1_1_1_37-bb"/><computeroutput>unordered_set</computeroutput> swaptemplate<typename Value, typename Hash, typename Pred, typename Alloc> void swap(unordered_set<Value, Hash, Pred, Alloc>& x, unordered_set<Value, Hash, Pred, Alloc>& y);typedef implementation-defined const_local_iterator; // construct/copy/destruct - explicit unordered_multiset(size_type = implementation-defined, + explicit unordered_multiset(size_type = implementation-defined, hasher const& = hasher(), key_equal const& = key_equal(), allocator_type const& = allocator_type()); template<typename InputIterator> - unordered_multiset(InputIterator, InputIterator, + unordered_multiset(InputIterator, InputIterator, size_type = implementation-defined, hasher const& = hasher(), key_equal const& = key_equal(), allocator_type const& = allocator_type()); - unordered_multiset(unordered_multiset const&); - unordered_multiset(unordered_multiset &&); - explicit unordered_multiset(Allocator const&); - unordered_multiset(unordered_multiset const&, Allocator const&); - ~unordered_multiset(); - unordered_multiset& operator=(unordered_multiset const&); - unordered_multiset& operator=(unordered_multiset &&); - allocator_type get_allocator() const; + unordered_multiset(unordered_multiset const&); + unordered_multiset(unordered_multiset &&); + explicit unordered_multiset(Allocator const&); + unordered_multiset(unordered_multiset const&, Allocator const&); + ~unordered_multiset(); + unordered_multiset& operator=(unordered_multiset const&); + unordered_multiset& operator=(unordered_multiset &&); + allocator_type get_allocator() const; - // size and capacity - bool empty() const; - size_type size() const; - size_type max_size() 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; + // 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&&...); - template<typename... Args> iterator emplace_hint(const_iterator, Args&&...); - iterator insert(value_type const&); - iterator insert(const_iterator, value_type const&); - template<typename InputIterator> void insert(InputIterator, InputIterator); - iterator erase(const_iterator); - size_type erase(key_type const&); - iterator erase(const_iterator, const_iterator); - void quick_erase(const_iterator); - void erase_return_void(const_iterator); - void clear(); - void swap(unordered_multiset&); + // modifiers + template<typename... Args> iterator emplace(Args&&...); + template<typename... Args> iterator emplace_hint(const_iterator, Args&&...); + iterator insert(value_type const&); + iterator insert(const_iterator, value_type const&); + template<typename InputIterator> void insert(InputIterator, InputIterator); + iterator erase(const_iterator); + size_type erase(key_type const&); + iterator erase(const_iterator, const_iterator); + void quick_erase(const_iterator); + void erase_return_void(const_iterator); + void clear(); + void swap(unordered_multiset&); - // observers - hasher hash_function() const; - key_equal key_eq() const; + // observers + hasher hash_function() const; + key_equal key_eq() const; - // lookup - iterator find(key_type const&); - const_iterator find(key_type const&) const; + // lookup + iterator find(key_type const&); + const_iterator find(key_type const&) const; template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> - iterator find(CompatibleKey const&, CompatibleHash const&, + iterator find(CompatibleKey const&, CompatibleHash const&, CompatiblePredicate const&); template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> const_iterator - find(CompatibleKey const&, CompatibleHash const&, + find(CompatibleKey const&, CompatibleHash const&, CompatiblePredicate const&) const; - size_type count(key_type const&) const; - std::pair<iterator, iterator> equal_range(key_type const&); - std::pair<const_iterator, const_iterator> equal_range(key_type const&) const; + size_type count(key_type const&) const; + std::pair<iterator, iterator> equal_range(key_type const&); + std::pair<const_iterator, const_iterator> equal_range(key_type const&) const; - // bucket interface - size_type bucket_count() const; - size_type max_bucket_count() const; - size_type bucket_size(size_type) const; - size_type bucket(key_type const&) const; - local_iterator begin(size_type); - const_local_iterator begin(size_type) const; - local_iterator end(size_type); - const_local_iterator end(size_type) const; - const_local_iterator cbegin(size_type) const; - const_local_iterator cend(size_type); + // bucket interface + size_type bucket_count() const; + size_type max_bucket_count() const; + size_type bucket_size(size_type) const; + size_type bucket(key_type const&) const; + local_iterator begin(size_type); + const_local_iterator begin(size_type) const; + local_iterator end(size_type); + const_local_iterator end(size_type) const; + const_local_iterator cbegin(size_type) const; + const_local_iterator cend(size_type); - // hash policy - float load_factor() const; - float max_load_factor() const; - void max_load_factor(float); - void rehash(size_type); + // hash policy + float load_factor() const; + float max_load_factor() const; + void max_load_factor(float); + void rehash(size_type); }; -// Equality Comparisons +// Equality Comparisons template<typename Value, typename Hash, typename Pred, typename Alloc> bool operator==(unordered_multiset<Value, Hash, Pred, Alloc> const&, unordered_multiset<Value, Hash, Pred, Alloc> const&); @@ -500,7 +500,7 @@ bool operator!=(unordered_multiset<Value, Hash, Pred, Alloc> const&, unordered_multiset<Value, Hash, Pred, Alloc> const&); -// swap +// swap template<typename Value, typename Hash, typename Pred, typename Alloc> void swap(unordered_multiset<Value, Hash, Pred, Alloc>&, unordered_multiset<Value, Hash, Pred, Alloc>&);Description @@ -557,32 +557,32 @@ A const_local_iterator object can be used to iterate through a single bucket. <anchor id="boost.unordered_multisetconstruct-copy-destruct"/><computeroutput>unordered_multiset</computeroutput> public - construct/copy/destructexplicit unordered_multiset(size_type n = implementation-defined, + construct/copy/destructexplicit unordered_multiset(size_type n = implementation-defined, hasher const& hf = hasher(), key_equal const& eq = key_equal(), allocator_type const& a = allocator_type());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0.Postconditions:size() == 0template<typename InputIterator> - unordered_multiset(InputIterator f, InputIterator l, + ?>Postconditions:size() == 0template<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());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.unordered_multiset(unordered_multiset const&);The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.allocator_type const& a = allocator_type());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.unordered_multiset(unordered_multiset const&);The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.Requires:value_type is copy constructibleunordered_multiset(unordered_multiset &&);The move constructor.Requires:value_type is copy constructibleunordered_multiset(unordered_multiset &&);The move constructor.Notes:This is emulated on compilers without rvalue references.Requires: value_type is move constructible. (TODO: This is not actually required in this implementation). - explicit unordered_multiset(Allocator const& a);Constructs an empty container, using allocator a.unordered_multiset(unordered_multiset const& x, Allocator const& a);Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a.~unordered_multiset();explicit unordered_multiset(Allocator const& a);Constructs an empty container, using allocator a.unordered_multiset(unordered_multiset const& x, Allocator const& a);Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a.~unordered_multiset();Notes:The destructor is applied to every element, and all memory is deallocatedunordered_multiset& operator=(unordered_multiset const&);The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.Notes:The destructor is applied to every element, and all memory is deallocatedunordered_multiset& operator=(unordered_multiset const&);The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.Notes: On compilers without rvalue references, there is a single assignment operator with the signature operator=(unordered_multiset) in order to emulate move semantics. - Requires:value_type is copy constructibleunordered_multiset& operator=(unordered_multiset &&);The move assignment operator.Requires:value_type is copy constructibleunordered_multiset& operator=(unordered_multiset &&);The move assignment operator.Notes: On compilers without rvalue references, there is a single assignment @@ -591,92 +591,92 @@ Requires: value_type is move constructible. (TODO: This is not actually required in this implementation). - allocator_type get_allocator() const;<anchor id="id-1.1.1.2.29-bb"/><computeroutput>unordered_multiset</computeroutput> size and capacitybool empty() const;allocator_type get_allocator() const;<anchor id="id-1_1_1_2_29-bb"/><computeroutput>unordered_multiset</computeroutput> size and capacitybool empty() const;Returns:size() == 0size_type size() const;Returns:size() == 0size_type size() const;Returns:std::distance(begin(), end())size_type max_size() const;Returns:std::distance(begin(), end())size_type max_size() const;Returns:size() of the largest possible container. - <anchor id="id-1.1.1.2.30-bb"/><computeroutput>unordered_multiset</computeroutput> iteratorsiterator begin(); -const_iterator begin() const;Returns:size() of the largest possible container. + <anchor id="id-1_1_1_2_30-bb"/><computeroutput>unordered_multiset</computeroutput> iteratorsiterator begin(); +const_iterator begin() const;Returns:An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. - iterator end(); -const_iterator end() const;iterator end(); +const_iterator end() const;Returns:An iterator which refers to the past-the-end value for the container. - const_iterator cbegin() const;const_iterator cbegin() const;Returns:A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. - const_iterator cend() const;const_iterator cend() const;Returns:A constant iterator which refers to the past-the-end value for the container. - <anchor id="id-1.1.1.2.31-bb"/><computeroutput>unordered_multiset</computeroutput> modifierstemplate<typename... Args> iterator emplace(Args&&... args);Inserts an object, constructed with the arguments args, in the container.<anchor id="id-1_1_1_2_31-bb"/><computeroutput>unordered_multiset</computeroutput> modifierstemplate<typename... Args> iterator emplace(Args&&... args);Inserts an object, constructed with the arguments args, in the container.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support for rvalue references or move semantics.template<typename... Args> - iterator emplace_hint(const_iterator hint, Args&&... args);Inserts an object, constructed with the arguments args, in the container.hint is a suggestion to where the element should be inserted.iterator emplace_hint(const_iterator hint, Args&&... args);Inserts an object, constructed with the arguments args, in the container.hint is a suggestion to where the element should be inserted.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support - for rvalue references or move semantics.iterator insert(value_type const& obj);Inserts obj in the container.iterator insert(value_type const& obj);Inserts obj in the container.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator insert(const_iterator hint, value_type const& obj);Inserts obj in the container.hint is a suggestion to where the element should be inserted.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator insert(const_iterator hint, value_type const& obj);Inserts obj in the container.hint is a suggestion to where the element should be inserted.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same value. Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.template<typename InputIterator> - void insert(InputIterator first, InputIterator last);Inserts a range of elements into the container.void insert(InputIterator first, InputIterator last);Inserts a range of elements into the container.Throws:When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator erase(const_iterator position);Erase the element pointed to by position.Throws:When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator erase(const_iterator position);Erase the element pointed to by position.Returns:The iterator following position before the erasure.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: When the number of elements is a lot smaller than the number of buckets this function can be very inefficient as it has to search through empty buckets for the next element, in order to return the iterator. - The method quick_erase is faster, but has yet + The method quick_erase is faster, but has yet to be standardized. - size_type erase(key_type const& k);Erase all elements with key equivalent to k.size_type erase(key_type const& k);Erase all elements with key equivalent to k.Returns:The number of elements erased.Throws:Only throws an exception if it is thrown by hasher or key_equal.iterator erase(const_iterator first, const_iterator last);Erases the elements in the range from first to last.Returns:The number of elements erased.Throws:Only throws an exception if it is thrown by hasher or key_equal.iterator erase(const_iterator first, const_iterator last);Erases the elements in the range from first to last.Returns:The iterator following the erased elements - i.e. last.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.void quick_erase(const_iterator position);Erase the element pointed to by position.Returns:The iterator following the erased elements - i.e. last.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.void quick_erase(const_iterator position);Erase the element pointed to by position.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: - This method is faster than erase as + This method is faster than erase as it doesn't have to find the next element in the container - a potentially costly operation. As it hasn't been standardized, it's likely that this may change in the future. - void erase_return_void(const_iterator position);Erase the element pointed to by position.void erase_return_void(const_iterator position);Erase the element pointed to by position.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: This method is now deprecated, use quick_return instead. Although be warned that as that isn't standardized yet, it could also change. - void clear();Erases all elements in the container.void clear();Erases all elements in the container.Postconditions:size() == 0Throws:Never throws an exception.void swap(unordered_multiset&);Postconditions:size() == 0Throws:Never throws an exception.void swap(unordered_multiset&);Throws:If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.Notes:For a discussion of the behavior when allocators aren't equal see - the implementation details.<anchor id="id-1.1.1.2.32-bb"/><computeroutput>unordered_multiset</computeroutput> observershasher hash_function() const;the implementation details.<anchor id="id-1_1_1_2_32-bb"/><computeroutput>unordered_multiset</computeroutput> observershasher hash_function() const;Returns:The container's hash function. - key_equal key_eq() const;key_equal key_eq() const;Returns:The container's key equality predicate. - <anchor id="id-1.1.1.2.33-bb"/><computeroutput>unordered_multiset</computeroutput> lookupiterator find(key_type const& k); -const_iterator find(key_type const& k) const; + <anchor id="id-1_1_1_2_33-bb"/><computeroutput>unordered_multiset</computeroutput> lookupiterator find(key_type const& k); +const_iterator find(key_type const& k) const; template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> - iterator find(CompatibleKey const& k, CompatibleHash const& hash, + iterator find(CompatibleKey const& k, CompatibleHash const& hash, CompatiblePredicate const& eq); template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> const_iterator - find(CompatibleKey const& k, CompatibleHash const& hash, + find(CompatibleKey const& k, CompatibleHash const& hash, CompatiblePredicate const& eq) const;Returns:An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists.Notes: @@ -684,41 +684,41 @@ allows you to use a compatible hash function and equality predicate for a key of a different type in order to avoid an expensive type cast. In general, its use is not encouraged. - size_type count(key_type const& k) const;size_type count(key_type const& k) const;Returns:The number of elements with key equivalent to k.std::pair<iterator, iterator> equal_range(key_type const& k); -std::pair<const_iterator, const_iterator> equal_range(key_type const& k) const;Returns:The number of elements with key equivalent to k.std::pair<iterator, iterator> equal_range(key_type const& k); +std::pair<const_iterator, const_iterator> equal_range(key_type const& k) const;Returns:A range containing all elements with key equivalent to k. If the container doesn't container any such elements, returns std::make_pair(b.end(),b.end()). - <anchor id="id-1.1.1.2.34-bb"/><computeroutput>unordered_multiset</computeroutput> bucket interfacesize_type bucket_count() const;<anchor id="id-1_1_1_2_34-bb"/><computeroutput>unordered_multiset</computeroutput> bucket interfacesize_type bucket_count() const;Returns:The number of buckets.size_type max_bucket_count() const;Returns:The number of buckets.size_type max_bucket_count() const;Returns:An upper bound on the number of buckets.size_type bucket_size(size_type n) const;Returns:An upper bound on the number of buckets.size_type bucket_size(size_type n) const;Requires:n < bucket_count()Returns:The number of elements in bucket n.size_type bucket(key_type const& k) const;Requires:n < bucket_count()Returns:The number of elements in bucket n.size_type bucket(key_type const& k) const;Returns:The index of the bucket which would contain an element with key k.Postconditions:The return value is less than bucket_count()local_iterator begin(size_type n); -const_local_iterator begin(size_type n) const;Returns:The index of the bucket which would contain an element with key k.Postconditions:The return value is less than bucket_count()local_iterator begin(size_type n); +const_local_iterator begin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the first element in the bucket with index n.local_iterator end(size_type n); -const_local_iterator end(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the first element in the bucket with index n.local_iterator end(size_type n); +const_local_iterator end(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the 'one past the end' element in the bucket with index n.const_local_iterator cbegin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the 'one past the end' element in the bucket with index n.const_local_iterator cbegin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the first element in the bucket with index n.const_local_iterator cend(size_type n);Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the first element in the bucket with index n.const_local_iterator cend(size_type n);Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the 'one past the end' element in the bucket with index n.<anchor id="id-1.1.1.2.35-bb"/><computeroutput>unordered_multiset</computeroutput> hash policyfloat load_factor() const;Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the 'one past the end' element in the bucket with index n.<anchor id="id-1_1_1_2_35-bb"/><computeroutput>unordered_multiset</computeroutput> hash policyfloat load_factor() const;Returns:The average number of elements per bucket.float max_load_factor() const;Returns:The average number of elements per bucket.float max_load_factor() const;Returns:Returns the current maximum load factor.void max_load_factor(float z);Returns:Returns the current maximum load factor.void max_load_factor(float z);Effects:Changes the container's maximum load factor, using z as a hint.void rehash(size_type n);Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor.Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.Effects:Changes the container's maximum load factor, using z as a hint.void rehash(size_type n);Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor.Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.Throws:The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.<anchor id="id-1.1.1.2.36-bb"/><computeroutput>unordered_multiset</computeroutput> Equality Comparisonstemplate<typename Value, typename Hash, typename Pred, typename Alloc> + ?>Throws:The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.<anchor id="id-1_1_1_2_36-bb"/><computeroutput>unordered_multiset</computeroutput> Equality Comparisonstemplate<typename Value, typename Hash, typename Pred, typename Alloc> bool operator==(unordered_multiset<Value, Hash, Pred, Alloc> const& x, unordered_multiset<Value, Hash, Pred, Alloc> const& y);unordered_multiset<Value, Hash, Pred, Alloc> const& y);Notes:This is a boost extension.Behavior is undefined if the two containers don't have - equivalent equality predicates.<anchor id="id-1.1.1.2.37-bb"/><computeroutput>unordered_multiset</computeroutput> swaptemplate<typename Value, typename Hash, typename Pred, typename Alloc> + equivalent equality predicates.<anchor id="id-1_1_1_2_37-bb"/><computeroutput>unordered_multiset</computeroutput> swaptemplate<typename Value, typename Hash, typename Pred, typename Alloc> void swap(unordered_multiset<Value, Hash, Pred, Alloc>& x, unordered_multiset<Value, Hash, Pred, Alloc>& y);typedef implementation-defined const_local_iterator; // construct/copy/destruct - explicit unordered_map(size_type = implementation-defined, + explicit unordered_map(size_type = implementation-defined, hasher const& = hasher(), key_equal const& = key_equal(), allocator_type const& = allocator_type()); template<typename InputIterator> - unordered_map(InputIterator, InputIterator, + unordered_map(InputIterator, InputIterator, size_type = implementation-defined, hasher const& = hasher(), key_equal const& = key_equal(), allocator_type const& = allocator_type()); - unordered_map(unordered_map const&); - unordered_map(unordered_map &&); - explicit unordered_map(Allocator const&); - unordered_map(unordered_map const&, Allocator const&); - ~unordered_map(); - unordered_map& operator=(unordered_map const&); - unordered_map& operator=(unordered_map &&); - allocator_type get_allocator() const; + unordered_map(unordered_map const&); + unordered_map(unordered_map &&); + explicit unordered_map(Allocator const&); + unordered_map(unordered_map const&, Allocator const&); + ~unordered_map(); + unordered_map& operator=(unordered_map const&); + unordered_map& operator=(unordered_map &&); + allocator_type get_allocator() const; - // size and capacity - bool empty() const; - size_type size() const; - size_type max_size() 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; + // 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> std::pair<iterator, bool> emplace(Args&&...); - template<typename... Args> iterator emplace_hint(const_iterator, Args&&...); - std::pair<iterator, bool> insert(value_type const&); - iterator insert(const_iterator, value_type const&); - template<typename InputIterator> void insert(InputIterator, InputIterator); - iterator erase(const_iterator); - size_type erase(key_type const&); - iterator erase(const_iterator, const_iterator); - void quick_erase(const_iterator); - void erase_return_void(const_iterator); - void clear(); - void swap(unordered_map&); + // modifiers + template<typename... Args> std::pair<iterator, bool> emplace(Args&&...); + template<typename... Args> iterator emplace_hint(const_iterator, Args&&...); + std::pair<iterator, bool> insert(value_type const&); + iterator insert(const_iterator, value_type const&); + template<typename InputIterator> void insert(InputIterator, InputIterator); + iterator erase(const_iterator); + size_type erase(key_type const&); + iterator erase(const_iterator, const_iterator); + void quick_erase(const_iterator); + void erase_return_void(const_iterator); + void clear(); + void swap(unordered_map&); - // observers - hasher hash_function() const; - key_equal key_eq() const; + // observers + hasher hash_function() const; + key_equal key_eq() const; - // lookup - iterator find(key_type const&); - const_iterator find(key_type const&) const; + // lookup + iterator find(key_type const&); + const_iterator find(key_type const&) const; template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> - iterator find(CompatibleKey const&, CompatibleHash const&, + iterator find(CompatibleKey const&, CompatibleHash const&, CompatiblePredicate const&); template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> const_iterator - find(CompatibleKey const&, CompatibleHash const&, + find(CompatibleKey const&, CompatibleHash const&, CompatiblePredicate const&) const; - size_type count(key_type const&) const; - std::pair<iterator, iterator> equal_range(key_type const&); - std::pair<const_iterator, const_iterator> equal_range(key_type const&) const; - mapped_type& operator[](key_type const&); - Mapped& at(key_type const&); - Mapped const& at(key_type const&) const; + size_type count(key_type const&) const; + std::pair<iterator, iterator> equal_range(key_type const&); + std::pair<const_iterator, const_iterator> equal_range(key_type const&) const; + mapped_type& operator[](key_type const&); + Mapped& at(key_type const&); + Mapped const& at(key_type const&) const; - // bucket interface - size_type bucket_count() const; - size_type max_bucket_count() const; - size_type bucket_size(size_type) const; - size_type bucket(key_type const&) const; - local_iterator begin(size_type); - const_local_iterator begin(size_type) const; - local_iterator end(size_type); - const_local_iterator end(size_type) const; - const_local_iterator cbegin(size_type) const; - const_local_iterator cend(size_type); + // bucket interface + size_type bucket_count() const; + size_type max_bucket_count() const; + size_type bucket_size(size_type) const; + size_type bucket(key_type const&) const; + local_iterator begin(size_type); + const_local_iterator begin(size_type) const; + local_iterator end(size_type); + const_local_iterator end(size_type) const; + const_local_iterator cbegin(size_type) const; + const_local_iterator cend(size_type); - // hash policy - float load_factor() const; - float max_load_factor() const; - void max_load_factor(float); - void rehash(size_type); + // hash policy + float load_factor() const; + float max_load_factor() const; + void max_load_factor(float); + void rehash(size_type); }; -// Equality Comparisons +// Equality Comparisons template<typename Key, typename Mapped, typename Hash, typename Pred, typename Alloc> bool operator==(unordered_map<Key, Mapped, Hash, Pred, Alloc> const&, @@ -894,7 +894,7 @@ bool operator!=(unordered_map<Key, Mapped, Hash, Pred, Alloc> const&, unordered_map<Key, Mapped, Hash, Pred, Alloc> const&); -// swap +// swap template<typename Key, typename Mapped, typename Hash, typename Pred, typename Alloc> void swap(unordered_map<Key, Mapped, Hash, Pred, Alloc>&, @@ -955,32 +955,32 @@ A const_local_iterator object can be used to iterate through a single bucket. <anchor id="boost.unordered_mapconstruct-copy-destruct"/><computeroutput>unordered_map</computeroutput> public - construct/copy/destructexplicit unordered_map(size_type n = implementation-defined, + construct/copy/destructexplicit unordered_map(size_type n = implementation-defined, hasher const& hf = hasher(), key_equal const& eq = key_equal(), allocator_type const& a = allocator_type());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0.Postconditions:size() == 0template<typename InputIterator> - unordered_map(InputIterator f, InputIterator l, + ?>Postconditions:size() == 0template<typename InputIterator> + unordered_map(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());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.unordered_map(unordered_map const&);The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.allocator_type const& a = allocator_type());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.unordered_map(unordered_map const&);The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.Requires:value_type is copy constructibleunordered_map(unordered_map &&);The move constructor.Requires:value_type is copy constructibleunordered_map(unordered_map &&);The move constructor.Notes:This is emulated on compilers without rvalue references.Requires: value_type is move constructible. (TODO: This is not actually required in this implementation). - explicit unordered_map(Allocator const& a);Constructs an empty container, using allocator a.unordered_map(unordered_map const& x, Allocator const& a);Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a.~unordered_map();explicit unordered_map(Allocator const& a);Constructs an empty container, using allocator a.unordered_map(unordered_map const& x, Allocator const& a);Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a.~unordered_map();Notes:The destructor is applied to every element, and all memory is deallocatedunordered_map& operator=(unordered_map const&);The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.Notes:The destructor is applied to every element, and all memory is deallocatedunordered_map& operator=(unordered_map const&);The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.Notes: On compilers without rvalue references, there is a single assignment operator with the signature operator=(unordered_map) in order to emulate move semantics. - Requires:value_type is copy constructibleunordered_map& operator=(unordered_map &&);The move assignment operator.Requires:value_type is copy constructibleunordered_map& operator=(unordered_map &&);The move assignment operator.Notes: On compilers without rvalue references, there is a single assignment @@ -989,92 +989,92 @@ Requires: value_type is move constructible. (TODO: This is not actually required in this implementation). - allocator_type get_allocator() const;<anchor id="id-1.2.1.1.30-bb"/><computeroutput>unordered_map</computeroutput> size and capacitybool empty() const;allocator_type get_allocator() const;<anchor id="id-1_2_1_1_30-bb"/><computeroutput>unordered_map</computeroutput> size and capacitybool empty() const;Returns:size() == 0size_type size() const;Returns:size() == 0size_type size() const;Returns:std::distance(begin(), end())size_type max_size() const;Returns:std::distance(begin(), end())size_type max_size() const;Returns:size() of the largest possible container. - <anchor id="id-1.2.1.1.31-bb"/><computeroutput>unordered_map</computeroutput> iteratorsiterator begin(); -const_iterator begin() const;Returns:size() of the largest possible container. + <anchor id="id-1_2_1_1_31-bb"/><computeroutput>unordered_map</computeroutput> iteratorsiterator begin(); +const_iterator begin() const;Returns:An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. - iterator end(); -const_iterator end() const;iterator end(); +const_iterator end() const;Returns:An iterator which refers to the past-the-end value for the container. - const_iterator cbegin() const;const_iterator cbegin() const;Returns:A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. - const_iterator cend() const;const_iterator cend() const;Returns:A constant iterator which refers to the past-the-end value for the container. - <anchor id="id-1.2.1.1.32-bb"/><computeroutput>unordered_map</computeroutput> modifierstemplate<typename... Args> std::pair<iterator, bool> emplace(Args&&... args);Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent key.<anchor id="id-1_2_1_1_32-bb"/><computeroutput>unordered_map</computeroutput> modifierstemplate<typename... Args> std::pair<iterator, bool> emplace(Args&&... args);Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent key.Returns:The bool component of the return type is true if an insert took place.If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support for rvalue references or move semantics.template<typename... Args> - iterator emplace_hint(const_iterator hint, Args&&... args);Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent key.hint is a suggestion to where the element should be inserted.iterator emplace_hint(const_iterator hint, Args&&... args);Inserts an object, constructed with the arguments args, in the container if and only if there is no element in the container with an equivalent key.hint is a suggestion to where the element should be inserted.Returns:If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support - for rvalue references or move semantics.std::pair<iterator, bool> insert(value_type const& obj);Inserts obj in the container if and only if there is no element in the container with an equivalent key.std::pair<iterator, bool> insert(value_type const& obj);Inserts obj in the container if and only if there is no element in the container with an equivalent key.Returns:The bool component of the return type is true if an insert took place.If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator insert(const_iterator hint, value_type const& obj);Inserts obj in the container if and only if there is no element in the container with an equivalent key.hint is a suggestion to where the element should be inserted.Returns:The bool component of the return type is true if an insert took place.If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator insert(const_iterator hint, value_type const& obj);Inserts obj in the container if and only if there is no element in the container with an equivalent key.hint is a suggestion to where the element should be inserted.Returns:If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.template<typename InputIterator> - void insert(InputIterator first, InputIterator last);Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent key.void insert(InputIterator first, InputIterator last);Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent key.Throws:When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator erase(const_iterator position);Erase the element pointed to by position.Throws:When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator erase(const_iterator position);Erase the element pointed to by position.Returns:The iterator following position before the erasure.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: When the number of elements is a lot smaller than the number of buckets this function can be very inefficient as it has to search through empty buckets for the next element, in order to return the iterator. - The method quick_erase is faster, but has yet + The method quick_erase is faster, but has yet to be standardized. - size_type erase(key_type const& k);Erase all elements with key equivalent to k.size_type erase(key_type const& k);Erase all elements with key equivalent to k.Returns:The number of elements erased.Throws:Only throws an exception if it is thrown by hasher or key_equal.iterator erase(const_iterator first, const_iterator last);Erases the elements in the range from first to last.Returns:The number of elements erased.Throws:Only throws an exception if it is thrown by hasher or key_equal.iterator erase(const_iterator first, const_iterator last);Erases the elements in the range from first to last.Returns:The iterator following the erased elements - i.e. last.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.void quick_erase(const_iterator position);Erase the element pointed to by position.Returns:The iterator following the erased elements - i.e. last.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.void quick_erase(const_iterator position);Erase the element pointed to by position.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: - This method is faster than erase as + This method is faster than erase as it doesn't have to find the next element in the container - a potentially costly operation. As it hasn't been standardized, it's likely that this may change in the future. - void erase_return_void(const_iterator position);Erase the element pointed to by position.void erase_return_void(const_iterator position);Erase the element pointed to by position.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: This method is now deprecated, use quick_return instead. Although be warned that as that isn't standardized yet, it could also change. - void clear();Erases all elements in the container.void clear();Erases all elements in the container.Postconditions:size() == 0Throws:Never throws an exception.void swap(unordered_map&);Postconditions:size() == 0Throws:Never throws an exception.void swap(unordered_map&);Throws:If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.Notes:For a discussion of the behavior when allocators aren't equal see - the implementation details.<anchor id="id-1.2.1.1.33-bb"/><computeroutput>unordered_map</computeroutput> observershasher hash_function() const;the implementation details.<anchor id="id-1_2_1_1_33-bb"/><computeroutput>unordered_map</computeroutput> observershasher hash_function() const;Returns:The container's hash function. - key_equal key_eq() const;key_equal key_eq() const;Returns:The container's key equality predicate. - <anchor id="id-1.2.1.1.34-bb"/><computeroutput>unordered_map</computeroutput> lookupiterator find(key_type const& k); -const_iterator find(key_type const& k) const; + <anchor id="id-1_2_1_1_34-bb"/><computeroutput>unordered_map</computeroutput> lookupiterator find(key_type const& k); +const_iterator find(key_type const& k) const; template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> - iterator find(CompatibleKey const& k, CompatibleHash const& hash, + iterator find(CompatibleKey const& k, CompatibleHash const& hash, CompatiblePredicate const& eq); template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> const_iterator - find(CompatibleKey const& k, CompatibleHash const& hash, + find(CompatibleKey const& k, CompatibleHash const& hash, CompatiblePredicate const& eq) const;Returns:An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists.Notes: @@ -1082,47 +1082,47 @@ allows you to use a compatible hash function and equality predicate for a key of a different type in order to avoid an expensive type cast. In general, its use is not encouraged. - size_type count(key_type const& k) const;size_type count(key_type const& k) const;Returns:The number of elements with key equivalent to k.std::pair<iterator, iterator> equal_range(key_type const& k); -std::pair<const_iterator, const_iterator> equal_range(key_type const& k) const;Returns:The number of elements with key equivalent to k.std::pair<iterator, iterator> equal_range(key_type const& k); +std::pair<const_iterator, const_iterator> equal_range(key_type const& k) const;Returns:A range containing all elements with key equivalent to k. If the container doesn't container any such elements, returns std::make_pair(b.end(),b.end()). - mapped_type& operator[](key_type const& k);mapped_type& operator[](key_type const& k);Effects:If the container does not already contain an elements with a key equivalent to k, inserts the value std::pair<key_type const, mapped_type>(k, mapped_type())Returns:A reference to x.second where x is the element already in the container, or the newly inserted element with a key equivalent to kThrows:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.Mapped& at(key_type const& k); -Mapped const& at(key_type const& k) const;Effects:If the container does not already contain an elements with a key equivalent to k, inserts the value std::pair<key_type const, mapped_type>(k, mapped_type())Returns:A reference to x.second where x is the element already in the container, or the newly inserted element with a key equivalent to kThrows:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.Mapped& at(key_type const& k); +Mapped const& at(key_type const& k) const;Returns:A reference to x.second where x is the (unique) element whose key is equivalent to k.Throws:An exception object of type std::out_of_range if no such element is present.Notes:This is not specified in the draft standard, but that is probably an oversight. The issue has been raised in - comp.std.c++.<anchor id="id-1.2.1.1.35-bb"/><computeroutput>unordered_map</computeroutput> bucket interfacesize_type bucket_count() const;comp.std.c++.<anchor id="id-1_2_1_1_35-bb"/><computeroutput>unordered_map</computeroutput> bucket interfacesize_type bucket_count() const;Returns:The number of buckets.size_type max_bucket_count() const;Returns:The number of buckets.size_type max_bucket_count() const;Returns:An upper bound on the number of buckets.size_type bucket_size(size_type n) const;Returns:An upper bound on the number of buckets.size_type bucket_size(size_type n) const;Requires:n < bucket_count()Returns:The number of elements in bucket n.size_type bucket(key_type const& k) const;Requires:n < bucket_count()Returns:The number of elements in bucket n.size_type bucket(key_type const& k) const;Returns:The index of the bucket which would contain an element with key k.Postconditions:The return value is less than bucket_count()local_iterator begin(size_type n); -const_local_iterator begin(size_type n) const;Returns:The index of the bucket which would contain an element with key k.Postconditions:The return value is less than bucket_count()local_iterator begin(size_type n); +const_local_iterator begin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the first element in the bucket with index n.local_iterator end(size_type n); -const_local_iterator end(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the first element in the bucket with index n.local_iterator end(size_type n); +const_local_iterator end(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the 'one past the end' element in the bucket with index n.const_local_iterator cbegin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the 'one past the end' element in the bucket with index n.const_local_iterator cbegin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the first element in the bucket with index n.const_local_iterator cend(size_type n);Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the first element in the bucket with index n.const_local_iterator cend(size_type n);Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the 'one past the end' element in the bucket with index n.<anchor id="id-1.2.1.1.36-bb"/><computeroutput>unordered_map</computeroutput> hash policyfloat load_factor() const;Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the 'one past the end' element in the bucket with index n.<anchor id="id-1_2_1_1_36-bb"/><computeroutput>unordered_map</computeroutput> hash policyfloat load_factor() const;Returns:The average number of elements per bucket.float max_load_factor() const;Returns:The average number of elements per bucket.float max_load_factor() const;Returns:Returns the current maximum load factor.void max_load_factor(float z);Returns:Returns the current maximum load factor.void max_load_factor(float z);Effects:Changes the container's maximum load factor, using z as a hint.void rehash(size_type n);Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor.Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.Effects:Changes the container's maximum load factor, using z as a hint.void rehash(size_type n);Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor.Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.Throws:The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.<anchor id="id-1.2.1.1.37-bb"/><computeroutput>unordered_map</computeroutput> Equality Comparisonstemplate<typename Key, typename Mapped, typename Hash, typename Pred, + ?>Throws:The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.<anchor id="id-1_2_1_1_37-bb"/><computeroutput>unordered_map</computeroutput> Equality Comparisonstemplate<typename Key, typename Mapped, typename Hash, typename Pred, typename Alloc> bool operator==(unordered_map<Key, Mapped, Hash, Pred, Alloc> const& x, unordered_map<Key, Mapped, Hash, Pred, Alloc> const& y);unordered_map<Key, Mapped, Hash, Pred, Alloc> const& y);Notes:This is a boost extension.Behavior is undefined if the two containers don't have - equivalent equality predicates.<anchor id="id-1.2.1.1.38-bb"/><computeroutput>unordered_map</computeroutput> swaptemplate<typename Key, typename Mapped, typename Hash, typename Pred, + equivalent equality predicates.<anchor id="id-1_2_1_1_38-bb"/><computeroutput>unordered_map</computeroutput> swaptemplate<typename Key, typename Mapped, typename Hash, typename Pred, typename Alloc> void swap(unordered_map<Key, Mapped, Hash, Pred, Alloc>& x, unordered_map<Key, Mapped, Hash, Pred, Alloc>& y);typedef implementation-defined const_local_iterator; // construct/copy/destruct - explicit unordered_multimap(size_type = implementation-defined, + explicit unordered_multimap(size_type = implementation-defined, hasher const& = hasher(), key_equal const& = key_equal(), allocator_type const& = allocator_type()); template<typename InputIterator> - unordered_multimap(InputIterator, InputIterator, + unordered_multimap(InputIterator, InputIterator, size_type = implementation-defined, hasher const& = hasher(), key_equal const& = key_equal(), allocator_type const& = allocator_type()); - unordered_multimap(unordered_multimap const&); - unordered_multimap(unordered_multimap &&); - explicit unordered_multimap(Allocator const&); - unordered_multimap(unordered_multimap const&, Allocator const&); - ~unordered_multimap(); - unordered_multimap& operator=(unordered_multimap const&); - unordered_multimap& operator=(unordered_multimap &&); - allocator_type get_allocator() const; + unordered_multimap(unordered_multimap const&); + unordered_multimap(unordered_multimap &&); + explicit unordered_multimap(Allocator const&); + unordered_multimap(unordered_multimap const&, Allocator const&); + ~unordered_multimap(); + unordered_multimap& operator=(unordered_multimap const&); + unordered_multimap& operator=(unordered_multimap &&); + allocator_type get_allocator() const; - // size and capacity - bool empty() const; - size_type size() const; - size_type max_size() 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; + // 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&&...); - template<typename... Args> iterator emplace_hint(const_iterator, Args&&...); - iterator insert(value_type const&); - iterator insert(const_iterator, value_type const&); - template<typename InputIterator> void insert(InputIterator, InputIterator); - iterator erase(const_iterator); - size_type erase(key_type const&); - iterator erase(const_iterator, const_iterator); - void quick_erase(const_iterator); - void erase_return_void(const_iterator); - void clear(); - void swap(unordered_multimap&); + // modifiers + template<typename... Args> iterator emplace(Args&&...); + template<typename... Args> iterator emplace_hint(const_iterator, Args&&...); + iterator insert(value_type const&); + iterator insert(const_iterator, value_type const&); + template<typename InputIterator> void insert(InputIterator, InputIterator); + iterator erase(const_iterator); + size_type erase(key_type const&); + iterator erase(const_iterator, const_iterator); + void quick_erase(const_iterator); + void erase_return_void(const_iterator); + void clear(); + void swap(unordered_multimap&); - // observers - hasher hash_function() const; - key_equal key_eq() const; + // observers + hasher hash_function() const; + key_equal key_eq() const; - // lookup - iterator find(key_type const&); - const_iterator find(key_type const&) const; + // lookup + iterator find(key_type const&); + const_iterator find(key_type const&) const; template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> - iterator find(CompatibleKey const&, CompatibleHash const&, + iterator find(CompatibleKey const&, CompatibleHash const&, CompatiblePredicate const&); template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> const_iterator - find(CompatibleKey const&, CompatibleHash const&, + find(CompatibleKey const&, CompatibleHash const&, CompatiblePredicate const&) const; - size_type count(key_type const&) const; - std::pair<iterator, iterator> equal_range(key_type const&); - std::pair<const_iterator, const_iterator> equal_range(key_type const&) const; + size_type count(key_type const&) const; + std::pair<iterator, iterator> equal_range(key_type const&); + std::pair<const_iterator, const_iterator> equal_range(key_type const&) const; - // bucket interface - size_type bucket_count() const; - size_type max_bucket_count() const; - size_type bucket_size(size_type) const; - size_type bucket(key_type const&) const; - local_iterator begin(size_type); - const_local_iterator begin(size_type) const; - local_iterator end(size_type); - const_local_iterator end(size_type) const; - const_local_iterator cbegin(size_type) const; - const_local_iterator cend(size_type); + // bucket interface + size_type bucket_count() const; + size_type max_bucket_count() const; + size_type bucket_size(size_type) const; + size_type bucket(key_type const&) const; + local_iterator begin(size_type); + const_local_iterator begin(size_type) const; + local_iterator end(size_type); + const_local_iterator end(size_type) const; + const_local_iterator cbegin(size_type) const; + const_local_iterator cend(size_type); - // hash policy - float load_factor() const; - float max_load_factor() const; - void max_load_factor(float); - void rehash(size_type); + // hash policy + float load_factor() const; + float max_load_factor() const; + void max_load_factor(float); + void rehash(size_type); }; -// Equality Comparisons +// Equality Comparisons template<typename Key, typename Mapped, typename Hash, typename Pred, typename Alloc> bool operator==(unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const&, @@ -1263,7 +1263,7 @@ bool operator!=(unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const&, unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const&); -// swap +// swap template<typename Key, typename Mapped, typename Hash, typename Pred, typename Alloc> void swap(unordered_multimap<Key, Mapped, Hash, Pred, Alloc>&, @@ -1324,32 +1324,32 @@ A const_local_iterator object can be used to iterate through a single bucket. <anchor id="boost.unordered_multimapconstruct-copy-destruct"/><computeroutput>unordered_multimap</computeroutput> public - construct/copy/destructexplicit unordered_multimap(size_type n = implementation-defined, + construct/copy/destructexplicit unordered_multimap(size_type n = implementation-defined, hasher const& hf = hasher(), key_equal const& eq = key_equal(), allocator_type const& a = allocator_type());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0.Postconditions:size() == 0template<typename InputIterator> - unordered_multimap(InputIterator f, InputIterator l, + ?>Postconditions:size() == 0template<typename InputIterator> + unordered_multimap(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());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.unordered_multimap(unordered_multimap const&);The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.allocator_type const& a = allocator_type());Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0 and inserts the elements from [f, l) into it.unordered_multimap(unordered_multimap const&);The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.Requires:value_type is copy constructibleunordered_multimap(unordered_multimap &&);The move constructor.Requires:value_type is copy constructibleunordered_multimap(unordered_multimap &&);The move constructor.Notes:This is emulated on compilers without rvalue references.Requires: value_type is move constructible. (TODO: This is not actually required in this implementation). - explicit unordered_multimap(Allocator const& a);Constructs an empty container, using allocator a.unordered_multimap(unordered_multimap const& x, Allocator const& a);Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a.~unordered_multimap();explicit unordered_multimap(Allocator const& a);Constructs an empty container, using allocator a.unordered_multimap(unordered_multimap const& x, Allocator const& a);Constructs an container, copying x's contained elements, hash function, predicate, maximum load factor, but using allocator a.~unordered_multimap();Notes:The destructor is applied to every element, and all memory is deallocatedunordered_multimap& operator=(unordered_multimap const&);The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.Notes:The destructor is applied to every element, and all memory is deallocatedunordered_multimap& operator=(unordered_multimap const&);The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.Notes: On compilers without rvalue references, there is a single assignment operator with the signature operator=(unordered_multimap) in order to emulate move semantics. - Requires:value_type is copy constructibleunordered_multimap& operator=(unordered_multimap &&);The move assignment operator.Requires:value_type is copy constructibleunordered_multimap& operator=(unordered_multimap &&);The move assignment operator.Notes: On compilers without rvalue references, there is a single assignment @@ -1358,92 +1358,92 @@ Requires: value_type is move constructible. (TODO: This is not actually required in this implementation). - allocator_type get_allocator() const;<anchor id="id-1.2.1.2.30-bb"/><computeroutput>unordered_multimap</computeroutput> size and capacitybool empty() const;allocator_type get_allocator() const;<anchor id="id-1_2_1_2_30-bb"/><computeroutput>unordered_multimap</computeroutput> size and capacitybool empty() const;Returns:size() == 0size_type size() const;Returns:size() == 0size_type size() const;Returns:std::distance(begin(), end())size_type max_size() const;Returns:std::distance(begin(), end())size_type max_size() const;Returns:size() of the largest possible container. - <anchor id="id-1.2.1.2.31-bb"/><computeroutput>unordered_multimap</computeroutput> iteratorsiterator begin(); -const_iterator begin() const;Returns:size() of the largest possible container. + <anchor id="id-1_2_1_2_31-bb"/><computeroutput>unordered_multimap</computeroutput> iteratorsiterator begin(); +const_iterator begin() const;Returns:An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. - iterator end(); -const_iterator end() const;iterator end(); +const_iterator end() const;Returns:An iterator which refers to the past-the-end value for the container. - const_iterator cbegin() const;const_iterator cbegin() const;Returns:A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container. - const_iterator cend() const;const_iterator cend() const;Returns:A constant iterator which refers to the past-the-end value for the container. - <anchor id="id-1.2.1.2.32-bb"/><computeroutput>unordered_multimap</computeroutput> modifierstemplate<typename... Args> iterator emplace(Args&&... args);Inserts an object, constructed with the arguments args, in the container.<anchor id="id-1_2_1_2_32-bb"/><computeroutput>unordered_multimap</computeroutput> modifierstemplate<typename... Args> iterator emplace(Args&&... args);Inserts an object, constructed with the arguments args, in the container.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support for rvalue references or move semantics.template<typename... Args> - iterator emplace_hint(const_iterator hint, Args&&... args);Inserts an object, constructed with the arguments args, in the container.hint is a suggestion to where the element should be inserted.iterator emplace_hint(const_iterator hint, Args&&... args);Inserts an object, constructed with the arguments args, in the container.hint is a suggestion to where the element should be inserted.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.If the compiler doesn't support variadic template arguments or rvalue references, this is emulated for up to 10 arguments, with no support - for rvalue references or move semantics.iterator insert(value_type const& obj);Inserts obj in the container.iterator insert(value_type const& obj);Inserts obj in the container.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator insert(const_iterator hint, value_type const& obj);Inserts obj in the container.hint is a suggestion to where the element should be inserted.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator insert(const_iterator hint, value_type const& obj);Inserts obj in the container.hint is a suggestion to where the element should be inserted.Returns:An iterator pointing to the inserted element.Throws:If an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same key. Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.template<typename InputIterator> - void insert(InputIterator first, InputIterator last);Inserts a range of elements into the container.void insert(InputIterator first, InputIterator last);Inserts a range of elements into the container.Throws:When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator erase(const_iterator position);Erase the element pointed to by position.Throws:When inserting a single element, if an exception is thrown by an operation other than a call to hasher the function has no effect.Notes:Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.Pointers and references to elements are never invalidated.iterator erase(const_iterator position);Erase the element pointed to by position.Returns:The iterator following position before the erasure.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: When the number of elements is a lot smaller than the number of buckets this function can be very inefficient as it has to search through empty buckets for the next element, in order to return the iterator. - The method quick_erase is faster, but has yet + The method quick_erase is faster, but has yet to be standardized. - size_type erase(key_type const& k);Erase all elements with key equivalent to k.size_type erase(key_type const& k);Erase all elements with key equivalent to k.Returns:The number of elements erased.Throws:Only throws an exception if it is thrown by hasher or key_equal.iterator erase(const_iterator first, const_iterator last);Erases the elements in the range from first to last.Returns:The number of elements erased.Throws:Only throws an exception if it is thrown by hasher or key_equal.iterator erase(const_iterator first, const_iterator last);Erases the elements in the range from first to last.Returns:The iterator following the erased elements - i.e. last.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.void quick_erase(const_iterator position);Erase the element pointed to by position.Returns:The iterator following the erased elements - i.e. last.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.void quick_erase(const_iterator position);Erase the element pointed to by position.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: - This method is faster than erase as + This method is faster than erase as it doesn't have to find the next element in the container - a potentially costly operation. As it hasn't been standardized, it's likely that this may change in the future. - void erase_return_void(const_iterator position);Erase the element pointed to by position.void erase_return_void(const_iterator position);Erase the element pointed to by position.Throws:Only throws an exception if it is thrown by hasher or key_equal.In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.Notes: This method is now deprecated, use quick_return instead. Although be warned that as that isn't standardized yet, it could also change. - void clear();Erases all elements in the container.void clear();Erases all elements in the container.Postconditions:size() == 0Throws:Never throws an exception.void swap(unordered_multimap&);Postconditions:size() == 0Throws:Never throws an exception.void swap(unordered_multimap&);Throws:If the allocators are equal, doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of key_equal or hasher.Notes:For a discussion of the behavior when allocators aren't equal see - the implementation details.<anchor id="id-1.2.1.2.33-bb"/><computeroutput>unordered_multimap</computeroutput> observershasher hash_function() const;the implementation details.<anchor id="id-1_2_1_2_33-bb"/><computeroutput>unordered_multimap</computeroutput> observershasher hash_function() const;Returns:The container's hash function. - key_equal key_eq() const;key_equal key_eq() const;Returns:The container's key equality predicate. - <anchor id="id-1.2.1.2.34-bb"/><computeroutput>unordered_multimap</computeroutput> lookupiterator find(key_type const& k); -const_iterator find(key_type const& k) const; + <anchor id="id-1_2_1_2_34-bb"/><computeroutput>unordered_multimap</computeroutput> lookupiterator find(key_type const& k); +const_iterator find(key_type const& k) const; template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> - iterator find(CompatibleKey const& k, CompatibleHash const& hash, + iterator find(CompatibleKey const& k, CompatibleHash const& hash, CompatiblePredicate const& eq); template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePredicate> const_iterator - find(CompatibleKey const& k, CompatibleHash const& hash, + find(CompatibleKey const& k, CompatibleHash const& hash, CompatiblePredicate const& eq) const;Returns:An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists.Notes: @@ -1451,41 +1451,41 @@ allows you to use a compatible hash function and equality predicate for a key of a different type in order to avoid an expensive type cast. In general, its use is not encouraged. - size_type count(key_type const& k) const;size_type count(key_type const& k) const;Returns:The number of elements with key equivalent to k.std::pair<iterator, iterator> equal_range(key_type const& k); -std::pair<const_iterator, const_iterator> equal_range(key_type const& k) const;Returns:The number of elements with key equivalent to k.std::pair<iterator, iterator> equal_range(key_type const& k); +std::pair<const_iterator, const_iterator> equal_range(key_type const& k) const;Returns:A range containing all elements with key equivalent to k. If the container doesn't container any such elements, returns std::make_pair(b.end(),b.end()). - <anchor id="id-1.2.1.2.35-bb"/><computeroutput>unordered_multimap</computeroutput> bucket interfacesize_type bucket_count() const;<anchor id="id-1_2_1_2_35-bb"/><computeroutput>unordered_multimap</computeroutput> bucket interfacesize_type bucket_count() const;Returns:The number of buckets.size_type max_bucket_count() const;Returns:The number of buckets.size_type max_bucket_count() const;Returns:An upper bound on the number of buckets.size_type bucket_size(size_type n) const;Returns:An upper bound on the number of buckets.size_type bucket_size(size_type n) const;Requires:n < bucket_count()Returns:The number of elements in bucket n.size_type bucket(key_type const& k) const;Requires:n < bucket_count()Returns:The number of elements in bucket n.size_type bucket(key_type const& k) const;Returns:The index of the bucket which would contain an element with key k.Postconditions:The return value is less than bucket_count()local_iterator begin(size_type n); -const_local_iterator begin(size_type n) const;Returns:The index of the bucket which would contain an element with key k.Postconditions:The return value is less than bucket_count()local_iterator begin(size_type n); +const_local_iterator begin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the first element in the bucket with index n.local_iterator end(size_type n); -const_local_iterator end(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the first element in the bucket with index n.local_iterator end(size_type n); +const_local_iterator end(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the 'one past the end' element in the bucket with index n.const_local_iterator cbegin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A local iterator pointing the 'one past the end' element in the bucket with index n.const_local_iterator cbegin(size_type n) const;Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the first element in the bucket with index n.const_local_iterator cend(size_type n);Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the first element in the bucket with index n.const_local_iterator cend(size_type n);Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the 'one past the end' element in the bucket with index n.<anchor id="id-1.2.1.2.36-bb"/><computeroutput>unordered_multimap</computeroutput> hash policyfloat load_factor() const;Requires:n shall be in the range [0, bucket_count()).Returns:A constant local iterator pointing the 'one past the end' element in the bucket with index n.<anchor id="id-1_2_1_2_36-bb"/><computeroutput>unordered_multimap</computeroutput> hash policyfloat load_factor() const;Returns:The average number of elements per bucket.float max_load_factor() const;Returns:The average number of elements per bucket.float max_load_factor() const;Returns:Returns the current maximum load factor.void max_load_factor(float z);Returns:Returns the current maximum load factor.void max_load_factor(float z);Effects:Changes the container's maximum load factor, using z as a hint.void rehash(size_type n);Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor.Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.Effects:Changes the container's maximum load factor, using z as a hint.void rehash(size_type n);Changes the number of buckets so that there at least n buckets, and so that the load factor is less than the maximum load factor.Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.Throws:The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.<anchor id="id-1.2.1.2.37-bb"/><computeroutput>unordered_multimap</computeroutput> Equality Comparisonstemplate<typename Key, typename Mapped, typename Hash, typename Pred, + ?>Throws:The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.<anchor id="id-1_2_1_2_37-bb"/><computeroutput>unordered_multimap</computeroutput> Equality Comparisonstemplate<typename Key, typename Mapped, typename Hash, typename Pred, typename Alloc> bool operator==(unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const& x, unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const& y);unordered_multimap<Key, Mapped, Hash, Pred, Alloc> const& y);Notes:This is a boost extension.Behavior is undefined if the two containers don't have - equivalent equality predicates.<anchor id="id-1.2.1.2.38-bb"/><computeroutput>unordered_multimap</computeroutput> swaptemplate<typename Key, typename Mapped, typename Hash, typename Pred, + equivalent equality predicates.<anchor id="id-1_2_1_2_38-bb"/><computeroutput>unordered_multimap</computeroutput> swaptemplate<typename Key, typename Mapped, typename Hash, typename Pred, typename Alloc> void swap(unordered_multimap<Key, Mapped, Hash, Pred, Alloc>& x, unordered_multimap<Key, Mapped, Hash, Pred, Alloc>& y);Methodname Test
Reference @@ -18,9 +18,9 @@ class foo { public: - void bar(int); - void operator()(int); -};Descriptionvoid bar(int);void operator()(int); + void bar(int); + void operator()(int); +};Descriptionvoid bar(int);void operator()(int);
\ No newline at end of file diff --git a/xsl/lookup.xsl b/xsl/lookup.xsl index ad8b5e3..91b4a59 100644 --- a/xsl/lookup.xsl +++ b/xsl/lookup.xsl @@ -22,10 +22,23 @@ - + + -bb + + + + + + + + + + + + @@ -234,7 +247,7 @@ translate($part, '.<>;\:*?"| ', '') != $part )"> - +