std::unordered_map::emplace — cppreference.com
Материал из cppreference.com
<metanoindex/>
<tbody> </tbody>
|
|
(начиная с C++11) | |
Вставляет новый элемент в контейнере. Элемент построен на месте, т.е. не копировать или перемещать операции. The constructor of the element type (value_type, that is, std::pair<const Key, T>) is called with exactly the same arguments as supplied to the function, forwarded with std::forward<Args>(args)....
Оригинал:
Inserts a new element to the container. The element is constructed in-place, i.e. no copy or move operations are performed. The constructor of the element type (value_type, that is, std::pair<const Key, T>) is called with exactly the same arguments as supplied to the function, forwarded with std::forward<Args>(args)....
Текст был переведён автоматически используя Переводчик Google.
Вы можете проверить и исправить перевод. Для инструкций щёлкните сюда.
Если во время вставки происходит перехеширование, все итераторы и указатели становятся недействительными. В противном случае итераторы и указатели остаются без изменений. Перехеширование происходит только если число элементов больше, чем max_load_factor()*bucket_count().
Параметры
| args | — | Аргументы направить в конструкторе элемента Оригинал: arguments to forward to the constructor of the element Текст был переведён автоматически используя Переводчик Google. |
Возвращаемое значение
returns a pair consisting of a bool denoting whether the insertion took place and an iterator to the inserted element.
Сложность
Amortized constant on average, worst case linear in the size of the container.
См. также
| создаёт элементы на месте, используя подсказку (public функция-элемент) [править] | |
| вставляет элементы или узлы (начиная с C++17) (public функция-элемент) [править] |