共用方式為


CMap::RemoveAll

從這個對應移除所有值可以藉由呼叫全域 Helper 函式 DestructElements

void RemoveAll( );

備註

如果對應已經是 null,則函式正確運作。

範例

CMap<int,int,CPoint,CPoint> myMap;

// Add 10 elements to the map.
for (int i=0;i < 10;i++)
   myMap.SetAt(i, CPoint(i, i));

myMap.RemoveAll();

ASSERT(myMap.IsEmpty());      

需求

Header: afxtempl.h

請參閱

參考

CMap 類別

階層架構圖

CMap::RemoveKey