Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Things to check
Flags
safe-html, strict-same
Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Effects:;; If the container does not already contain an elements with a key equivalent to `k`, inserts the value效果:;; 如果容器中尚不存在键与 `k` 等价的元素,则插入值 `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. + + The `template<class K>` overload only participates in overload resolution if。返回:;; 指向 `x.second` 的引用,其中 `x` 是容器中已存在的元素,或者是键与 `k` 等价的新插入元素。
抛出:;; 如果除调用 `hasher` 之外的操作抛出异常,则该函数无效。
备注:;; 可能使迭代器失效,但仅当插入导致负载因子大于或等于最大负载因子时才会发生。
此外,指向元素的指针和引用永远不会失效。
另外,仅当 `Hash::is_transparent`
and和 `Pred::is_transparent`are valid member typedefs. The library assumes that `Hash` is callable with both是有效的成员 typedef 时,`template<class k="">` 重载才会参与重载决议。库假定 `Hash` 可同时以 `K`and和 `Key`and that `Pred` is transparent. This enables heterogeneous lookup which avoids the cost of instantiating an instance of the `Key`类型调用,且 `Pred` 是透明的。这支持了异构查找,从而避免了实例化 `Key` 类型的开销。</class></key_type.>