Compartir a través de


CRBMap::SetAt

Call this method to insert an element pair into the map.

POSITION SetAt(
   KINARGTYPE key,
   VINARGTYPE value 
) throw(...);

Parameters

  • key
    The key value to add to the CRBMap object.

  • value
    The value to add to the CRBMap object.

Return Value

Returns the position of the key/value element pair in the CRBMap object.

Remarks

SetAt replaces an existing element if a matching key is found. If the key is not found, a new key/value pair is created.

See the documentation for the base class CRBTree for information on the other methods available.

Example

// Add an element to the map, with a key of 0
myMap.SetAt(0,1.1);

Requirements

Header: atlcoll.h

See Also

Reference

CRBMap Class

CRBMap::RemoveKey

Other Resources

CRBMap Members