mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Add whitespace to description lists for unordered_map
This commit is contained in:
@ -401,6 +401,7 @@ The copy constructor. Copies the contained elements, hash function, predicate, m
|
||||
|
||||
If `Allocator::select_on_container_copy_construction` exists and has the right signature, the allocator will be constructed from its result.
|
||||
|
||||
[horizontal]
|
||||
Requires:: `value_type` is copy constructible
|
||||
|
||||
---
|
||||
@ -414,7 +415,9 @@ The move constructor.
|
||||
|
||||
[horizontal]
|
||||
Notes:: This is implemented using Boost.Move.
|
||||
Requires:: `value_type` is move-constructible. On compilers without rvalue reference support the emulation does not support moving without calling `boost::move` if `value_type` is not copyable.
|
||||
Requires:: `value_type` is move-constructible. +
|
||||
+
|
||||
On compilers without rvalue reference support the emulation does not support moving without calling `boost::move` if `value_type` is not copyable.
|
||||
So, for example, you can't return the container from a function.
|
||||
|
||||
---
|
||||
@ -574,6 +577,7 @@ unordered_map& operator=(initializer_list<value_type> il);
|
||||
|
||||
Assign from values in initializer list. All existing elements are either overwritten by the new elements or destroyed.
|
||||
|
||||
[horizontal]
|
||||
Requires:: `value_type` is https://en.cppreference.com/w/cpp/named_req/CopyInsertable[CopyInsertable^] into the container and https://en.cppreference.com/w/cpp/named_req/CopyAssignable[CopyAssignable^].
|
||||
|
||||
=== Iterators
|
||||
@ -667,11 +671,15 @@ Inserts an object, constructed with the arguments `args`, in the container if an
|
||||
[horizontal]
|
||||
Requires:: `value_type` is https://en.cppreference.com/w/cpp/named_req/EmplaceConstructible[EmplaceConstructible^] into `X` from `args`.
|
||||
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.
|
||||
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. +
|
||||
+
|
||||
Since existing `std::pair` implementations don't support `std::piecewise_construct` this emulates it, but using `boost::unordered::piecewise_construct`.
|
||||
|
||||
---
|
||||
@ -689,10 +697,14 @@ Inserts an object, constructed with the arguments `args`, in the container if an
|
||||
Requires:: `value_type` is https://en.cppreference.com/w/cpp/named_req/EmplaceConstructible[EmplaceConstructible^] into `X` from `args`.
|
||||
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.
|
||||
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. +
|
||||
+
|
||||
Since existing `std::pair` implementations don't support `std::piecewise_construct` this emulates it, but using `boost::unordered::piecewise_construct`.
|
||||
|
||||
---
|
||||
@ -706,9 +718,13 @@ Inserts `obj` in the container if and only if there is no element in the contain
|
||||
|
||||
[horizontal]
|
||||
Requires:: `value_type` is https://en.cppreference.com/w/cpp/named_req/CopyInsertable[CopyInsertable^].
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -721,9 +737,13 @@ Inserts `obj` in the container if and only if there is no element in the contain
|
||||
|
||||
[horizontal]
|
||||
Requires:: `value_type` is https://en.cppreference.com/w/cpp/named_req/MoveInsertable[MoveInsertable^].
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -737,7 +757,9 @@ Inserts an element into the container by performing `emplace(std::forward<P>(val
|
||||
Only participates in overload resolution if `std::is_constructible<value_type, P&&>::value` is `true`.
|
||||
|
||||
[horizontal]
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -753,7 +775,11 @@ Inserts `obj` in the container if and only if there is no element in the contain
|
||||
Requires:: `value_type` is https://en.cppreference.com/w/cpp/named_req/CopyInsertable[CopyInsertable^].
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -770,7 +796,11 @@ Inserts `obj` in the container if and only if there is no element in the contain
|
||||
Requires:: `value_type` is https://en.cppreference.com/w/cpp/named_req/MoveInsertable[MoveInsertable^].
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -788,7 +818,11 @@ Only participates in overload resolution if `std::is_constructible<value_type, P
|
||||
|
||||
[horizontal]
|
||||
Returns:: If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent key.
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -802,7 +836,9 @@ Inserts a range of elements into the container. Elements are inserted if and onl
|
||||
[horizontal]
|
||||
Requires:: `value_type` is https://en.cppreference.com/w/cpp/named_req/EmplaceConstructible[EmplaceConstructible^] into `X` from `*first`.
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -816,7 +852,9 @@ Inserts a range of elements into the container. Elements are inserted if and onl
|
||||
[horizontal]
|
||||
Requires:: `value_type` is https://en.cppreference.com/w/cpp/named_req/EmplaceConstructible[EmplaceConstructible^] into `X` from `*first`.
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -874,9 +912,17 @@ Otherwise inserts the element owned by `nh` if and only if there is no element i
|
||||
|
||||
[horizontal]
|
||||
Requires:: `nh` is empty or `nh.get_allocator()` is equal to the container's allocator.
|
||||
Returns:: If `nh` was empty, returns an `insert_return_type` with: `inserted` equal to `false`, `position` equal to `end()` and `node` empty. Otherwise if there was already an element with an equivalent key, returns an `insert_return_type` with: `inserted` equal to `false`, `position` pointing to a matching element and `node` contains the node from `nh`. Otherwise if the insertion succeeded, returns an `insert_return_type` with: `inserted` equal to `true`, `position` pointing to the newly inserted element and `node` empty.
|
||||
Returns:: If `nh` was empty, returns an `insert_return_type` with: `inserted` equal to `false`, `position` equal to `end()` and `node` empty. +
|
||||
+
|
||||
Otherwise if there was already an element with an equivalent key, returns an `insert_return_type` with: `inserted` equal to `false`, `position` pointing to a matching element and `node` contains the node from `nh`. +
|
||||
+
|
||||
Otherwise if the insertion succeeded, returns an `insert_return_type` with: `inserted` equal to `true`, `position` pointing to the newly inserted element and `node` empty.
|
||||
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. In C++17 this can be used to insert a node extracted from a compatible `unordered_multimap`, but that is not supported yet.
|
||||
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. +
|
||||
+
|
||||
In C++17 this can be used to insert a node extracted from a compatible `unordered_multimap`, but that is not supported yet.
|
||||
|
||||
---
|
||||
|
||||
@ -895,9 +941,19 @@ If there is already an element in the container with an equivalent key has no ef
|
||||
|
||||
[horizontal]
|
||||
Requires:: `nh` is empty or `nh.get_allocator()` is equal to the container's allocator.
|
||||
Returns:: If `nh` was empty returns `end()`. If there was already an element in the container with an equivalent key returns an iterator pointing to that. Otherwise returns an iterator pointing to the newly inserted element.
|
||||
Returns:: If `nh` was empty returns `end()`. +
|
||||
+
|
||||
If there was already an element in the container with an equivalent key returns an iterator pointing to that. +
|
||||
+
|
||||
Otherwise returns an iterator pointing to the newly 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. In C++17 this can be used to insert a node extracted from a compatible `unordered_multimap`, but that is not supported yet.
|
||||
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. +
|
||||
+
|
||||
In C++17 this can be used to insert a node extracted from a compatible `unordered_multimap`, but that is not supported yet.
|
||||
|
||||
---
|
||||
|
||||
@ -955,7 +1011,9 @@ Erases the elements in the range from `first` to `last`.
|
||||
|
||||
[horizontal]
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -967,7 +1025,9 @@ void quick_erase(const_iterator position);
|
||||
Erase the element pointed to by `position`.
|
||||
|
||||
[horizontal]
|
||||
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.
|
||||
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 was implemented because returning an iterator to the next element from erase was expensive, but the container has been redesigned so that is no longer the case. So this method is now deprecated.
|
||||
|
||||
---
|
||||
@ -980,7 +1040,9 @@ void erase_return_void(const_iterator position);
|
||||
Erase the element pointed to by `position`.
|
||||
|
||||
[horizontal]
|
||||
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.
|
||||
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 was implemented because returning an iterator to the next element from erase was expensive, but the container has been redesigned so that is no longer the case. So this method is now deprecated.
|
||||
|
||||
---
|
||||
@ -1089,6 +1151,7 @@ template<typename CompatibleKey, typename CompatibleHash, typename CompatiblePre
|
||||
[horizontal]
|
||||
Returns:: An iterator pointing to an element with key equivalent to `k`, or `b.end()` if no such element exists.
|
||||
Notes:: The templated overloads containing `CompatibleKey`, `CompatibleHash` and `CompatiblePredicate` are non-standard extensions which allow 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 and instead the `K` member function templates should be used. +
|
||||
+
|
||||
The `template <typename K>` overloads only participate in overload resolution if `Hash::is_transparent` and `Pred::is_transparent` are valid member typedefs. The library assumes that `Hash` is callable with both `K` and `Key` and that `Pred` is transparent. This enables heterogeneous lookup which avoids the cost of instantiating an instance of the `Key` type.
|
||||
|
||||
---
|
||||
@ -1145,7 +1208,9 @@ mapped_type& operator[](key_type&& 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 `k`.
|
||||
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.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
@ -1322,7 +1387,9 @@ template<class Key, class T, class Hash, class Pred, class Alloc>
|
||||
Return `true` if `x.size() == y.size()` and for every element in `x`, there is an element in `y` with the same key, with an equal value (using `operator==` to compare the value types).
|
||||
|
||||
[horizontal]
|
||||
Notes:: The behavior of this function was changed to match the C++11 standard in Boost 1.48. Behavior is undefined if the two containers don't have equivalent equality predicates.
|
||||
Notes:: The behavior of this function was changed to match the C++11 standard in Boost 1.48. +
|
||||
+
|
||||
Behavior is undefined if the two containers don't have equivalent equality predicates.
|
||||
|
||||
---
|
||||
|
||||
@ -1336,7 +1403,9 @@ template<class Key, class T, class Hash, class Pred, class Alloc>
|
||||
Return `false` if `x.size() == y.size()` and for every element in `x`, there is an element in `y` with the same key, with an equal value (using `operator==` to compare the value types).
|
||||
|
||||
[horizontal]
|
||||
Notes:: The behavior of this function was changed to match the C++11 standard in Boost 1.48. Behavior is undefined if the two containers don't have equivalent equality predicates.
|
||||
Notes:: The behavior of this function was changed to match the C++11 standard in Boost 1.48. +
|
||||
+
|
||||
Behavior is undefined if the two containers don't have equivalent equality predicates.
|
||||
|
||||
=== Swap
|
||||
```c++
|
||||
|
Reference in New Issue
Block a user