Share via


CAtlList::GetNext

 

Call this method to return the next element from the list.

Syntax

      E& GetNext(
   POSITION& pos 
) throw( );
const E& GetNext(
   POSITION& pos 
) const throw( );

Parameters

Return Value

If the list is const, GetNext returns a copy of the next element of the list. This allows the method to be used only on the right side of an assignment statement and protects the list from modification.

If the list is not const, GetNext returns a reference to the next element of the list. This allows the method to be used on either side of an assignment statement and thus allows the list entries to be modified.

Remarks

The POSITION counter, pos, is updated to point to the next element in the list, or NULL if there are no more elements. In debug builds, an assertion failure will occur if pos is equal to NULL.

Example

See the example for CAtlList::GetHeadPosition.

Requirements

Header: atlcoll.h

See Also

CAtlList Class
CAtlList::GetPrev