diff --git a/doc/unordered/unordered_map.adoc b/doc/unordered/unordered_map.adoc index fad732d3..0a5e0469 100644 --- a/doc/unordered/unordered_map.adoc +++ b/doc/unordered/unordered_map.adoc @@ -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 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

(val Only participates in overload resolution if `std::is_constructible::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` 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(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 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 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++