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 element 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 to be greater than the maximum load. + + The `template<class K>` overload only participates in overload resolution if。返回:对 `x.second` 的引用,其中 `x` 是容器中已存在的元素,或是新插入的键与 `k` 等价的元素。
抛出:如果除调用 `hasher` 之外的操作抛出异常,则该函数无效果。
注意:可能使迭代器失效,但仅当插入导致负载大于最大负载时才会发生。
`template<class k="">` 重载仅在 `Hash::is_transparent`
and和 `Pred::is_transparent`are valid member typedefs. The library assumes that `Hash` is callable with both是有效的成员 typedef 时参与重载决议。库假定 `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.>