Use this operator as a convenient substitute for the SetAt member function. You can only use it 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.
VALUE& operator[]( ARG_KEY key );
Header file: | Afxtempl.h |
Platforms: | |
Versions: | 1.0 and later |
Complete documentation: | Visual C++ documentation |
CMap Overview, CMap Operators, Map Classes, CMap::SetAt, CMap::Lookup