Fix API docs to show the correct return type for emplace/insert for multimap and multiset

This commit is contained in:
Christian Mazakas
2022-02-14 12:30:31 -08:00
parent b019f17590
commit 83423adc05
3 changed files with 19 additions and 19 deletions
+3 -3
View File
@@ -131,7 +131,7 @@ public:
iterator insert(const_iterator hint, node_type&& nh);
template <class P>
std::pair<iterator, bool>
iterator
insert(const_iterator hint, P&& value);
template<typename InputIterator>
@@ -883,13 +883,13 @@ std::pair<iterator, bool>
insert(const_iterator hint, P&& value);
```
Inserts an element into the container by performing `emplace(std::forward<P>(value))`.
Inserts an element into the container by performing `emplace_hint(hint, std::forward<P>(value))`.
Only participates in overload resolution if `std::is_constructible<value_type, P&&>::value` is `true`.
`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.
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.