Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CList::GetAt

 

Gets the list element at a given position.


      TYPE
      & GetAt(
   POSITION position 
);
const TYPE& GetAt(
   POSITION position 
) const;

TYPE

Template parameter specifying the type of object in the list.

position

The position in the list of the element to get.

See the return value description for GetHead.

GetAt returns the element (or a reference to the element) associated with a given position. It is not the same as an index, and you cannot operate on a POSITION value yourself. A variable of type POSITION is a key for the list.

You must ensure that your POSITION value represents a valid position in the list. If it is invalid, then the Debug version of the Microsoft Foundation Class Library asserts.

Example

See the example for CList::GetHeadPosition.

Requirements

Header: afxtempl.h

Show: