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.

CAtlArray::operator

 

Call this operator to return a reference to an element in the array.


      E& operator[](
   size_t iElement 
) throw( );
const E& operator[](
   size_t iElement 
) const throw( );

iElement

The index value of the array element to return.

Returns a reference to the required array element.

Performs a similar function to CAtlArray::GetAt. Unlike the MFC class CArray, this operator cannot be used as a substitute for CAtlArray::SetAt.

In debug builds, an ATLASSERT will be raised if iElement exceeds the total number of elements in the array. In retail builds, an invalid parameter may cause unpredictable results.

Requirements

Header: atlcoll.h

Show: