Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Call this method to obtain the position of the head of the list.
POSITION GetHeadPosition( ) const throw( );
Return Value
Returns the POSITION value corresponding to the element at the head of the list.
Remarks
If the list is empty, the value returned is NULL.
Example
// Define the integer list
CAtlList<int> myList;
int i;
// Populate the list
for (i = 0; i < 100; i++)
{
myList.AddTail(i);
}
// Get the starting position value
POSITION myPos = myList.GetHeadPosition();
// Iterate through the entire list
i = 0;
int j;
do {
j = myList.GetNext(myPos);
ATLASSERT(i == j);
i++;
} while (myPos != NULL);
Requirements
Header: atlcoll.h