CMap::operator [ ]

VALUE& operator[]( ARG_KEY key );

Parameters

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.

Remarks

This operator is a convenient substitute for the SetAt member function. 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.

Example

See the example for CMap::Lookup.

CMap OverviewClass MembersHierarchy Chart

See Also   CMap::SetAt, CMap::Lookup