std::map::insert
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| std::pair<iterator,bool> insert( const value_type& value ); |
(1) | |
| template <class P> std::pair<iterator,bool> insert( P&& value ); |
(2) | (desde C++11) |
| iterator insert( iterator hint, const value_type& value ); iterator insert( const_iterator hint, const value_type& value ); |
(3) | (hasta C++11) (desde C++11) |
| template <class P> iterator insert( const_iterator hint, P&& value ); |
(4) | (desde C++11) |
| template< class InputIt > void insert( InputIt first, InputIt last ); |
(5) | |
| void insert( std::initializer_list<value_type> ilist ); |
(6) | (desde C++11) |
Inserts element(s) to the container, if the container doesn't already contain an element with equivalent key.
1-2)value. value. You can help to correct and verify the translation. Click here for instructions.
3-4) inserts value in the position as close as possible, just prior(desde C++11), to hint.
[first, last) rango .[first, last).You can help to correct and verify the translation. Click here for instructions.
ilist .ilist.You can help to correct and verify the translation. Click here for instructions.
No iterators or references are invalidated.
Contenido |
[editar] Parámetros
| hint | - | iterador, usado como una sugerencia en cuanto a dónde insertar el contenido
Original: iterator, used as a suggestion as to where to insert the content The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| value | - | elemento de valor que se inserta
Original: element value to insert The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| first, last | - | serie de elementos a insertar
Original: range of elements to insert The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| ilist | - | lista de inicializadores para insertar los valores de
Original: initializer list to insert the values from The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| Requerimientos de tipo | ||
-InputIt debe reunir los requerimientos de InputIterator.
| ||
[editar] Valor de retorno
1-2) returns a pair consisting of an iterator to the inserted element (or to the element that prevented the insertion) and a bool denoting whether the insertion took place.
3-4) returns an iterator to the inserted element, or to the element that prevented the insertion.
5-6)You can help to correct and verify the translation. Click here for instructions.
[editar] Complejidad
1-2) Logarithmic in the size of the container, O(log(size())).
3-4) Amortized constant if the insertion happens in the position just after(hasta C++11)/before(desde C++11) the hint, logarithmic in the size of the container otherwise.
5-6) O(N*log(size() + N)), where N is the number of elements to insert.
[editar] Ver también
| (C++11) |
construye el elemento en el sitio Original: constructs element in-place The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función miembro público) |
| (C++11) |
construye elementos en el lugar utilizando una pista Original: constructs elements in-place using a hint The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función miembro público) |

