Compartilhar via


CMap::GetNextAssoc

Retrieves the map element at rNextPosition, then updates rNextPosition to refer to the next element in the map.

void GetNextAssoc(
   POSITION& rNextPosition,
   KEY& rKey,
   VALUE& rValue 
) const;

Parameters

  • rNextPosition
    Specifies a reference to a POSITION value returned by a previous GetNextAssoc or GetStartPosition call.

  • KEY
    Template parameter specifying the type of the map's key.

  • rKey
    Specifies the returned key of the retrieved element.

  • VALUE
    Template parameter specifying the type of the map's value.

  • rValue
    Specifies the returned value of the retrieved element.

Remarks

This function is most useful for iterating through all the elements in the map. Note that the position sequence is not necessarily the same as the key value sequence.

If the retrieved element is the last in the map, then the new value of rNextPosition is set to NULL.

Example

See the example for CMap::SetAt.

Requirements

Header: afxtempl.h

See Also

Reference

CMap Class

Hierarchy Chart

CMap::GetStartPosition

Other Resources

CMap Members