CMap::operator [ ]
A convenient substitute for the SetAt member function.
VALUE& operator[](
ARG_KEY key
);
Параметры
VALUE
Template parameter specifying the type of the map value.ARG_KEY
Template parameter specifying the type of the key value.key
The key used to retrieve the value from the map.
Заметки
Thus it can be used only on the left side of an assignment statement (an l-value). If there is no map element with the specified key, then a new element is created.
There is no "right side" (r-value) equivalent to this operator because there is a possibility that a key may not be found in the map. Use the Lookup member function for element retrieval.
Пример
See the example for CMap::Lookup.
Требования
Header: afxtempl.h