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( );

Parameters

  • iElement
    The index value of the array element to return.

Return Value

Returns a reference to the required array element.

Remarks

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

See Also

Reference

CAtlArray Class

Other Resources

CAtlArray Members