Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Flags
safe-html, strict-same
Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Requires:;;要求:`value_type`is需从 `k` 处满足对容器的 https://en.cppreference.com/w/cpp/named_req/EmplaceConstructible[EmplaceConstructible^] from `k`. 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. + + This overload only participates in overload resolution if可原位构造^] 要求。返回:若执行了插入,则返回类型中的布尔分量为 `true`。+ +若执行了插入,则迭代器指向新插入的元素;否则指向等价的元素。抛出:若调用 `hasher` 以外的操作抛出异常,则函数无效果。说明:可能使迭代器失效,但仅当插入导致负载因子大于或等于最大负载因子时才会发生。+ +指向元素的指针和引用永远不会失效。+ +此重载仅在以下条件下参与重载决议:`Hash::is_transparent`and和 `Pred::is_transparent`are valid member typedefs and neither是有效的成员 typedef,且 `iterator`nor和 `const_iterator`are implicitly convertible from `K`. The library assumes that `Hash` is callable with both均不能从 `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` type.调用,且 `Pred` 是透明的。这实现了异构查找,从而避免了实例化 `Key` 类型对象的开销。