std::map::operator[]
Aus cppreference.com
|
|
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. |
<metanoindex/>
<tbody> </tbody> T& operator[]( const Key& key ); |
(1) | |
T& operator[]( Key&& key ); |
(2) | (seit C++11) |
Fügt ein neues Element in den Behälter mit
key als Schlüssel und Standard gebaut mapped Wert und gibt einen Verweis auf das neu errichtete kartiert Wert. Wenn ein Element mit Schlüssel key bereits existiert, wird keine Insertion durchgeführt und ein Verweis auf seine kartiert Wert zurückgegeben .Original:
Inserts a new element to the container using
key as the key and default constructed mapped value and returns a reference to the newly constructed mapped value. If an element with key key already exists, no insertion is performed and a reference to its mapped value is returned.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
1)
Führt im wesentlichen
(insert(std::make_pair(key, T())).first)->second .Original:
Essentially performs
(insert(std::make_pair(key, T())).first)->second.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
2)
Führt im wesentlichen
(insert(std::make_pair(std::move(key), T())).first)->second .Original:
Essentially performs
(insert(std::make_pair(std::move(key), T())).first)->second.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
No iterators or references are invalidated.
Parameter
| key | - | der Schlüssel des Elements zu finden
Original: the key of the element to find The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Rückgabewert
Bezugnahme auf den zugeordneten Wert des neuen Elements, wenn kein Element mit Schlüssel
key existierte. Andernfalls wird ein Verweis auf das zugeordnete Wert der bestehenden Element zurückgegeben .Original:
Reference to the mapped value of the new element if no element with key
key existed. Otherwise a reference to the mapped value of the existing element is returned.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Komplexität
Logarithmic in the size of the container.
Beispiel
| This section is incomplete Reason: no example |
Siehe auch
(C++11) |
Zugriff auf angegebene Element mit Überprüfung von Grenzen Original: access specified element with bounds checking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) |