Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CSimpleArray Class
Collapse the table of content
Expand the table of content

CSimpleArray Class

This class provides methods for managing a simple array.

template <
   class T,
   class TEqual = CSimpleArrayEqualHelper< T >
class CSimpleArray


The type of data to store in the array.


A trait object, defining the equality test for elements of type T.

CSimpleArray provides methods for creating and managing a simple array, of any given type T.

The parameter TEqual provides a means of defining an equality function for two elements of type T. By creating a class similar to CSimpleArrayEqualHelper, it is possible to alter the behavior of the equality test for any given array. For example, when dealing with an array of pointers, it may be useful to define the equality as depending on the values the pointers reference. The default implementation utilizes operator=().

Both CSimpleArray and CSimpleMap are designed for a small number of elements. CAtlArray and CAtlMap should be used when the array contains a large number of elements.

Header: atlsimpcoll.h

// Create an array of integers
CSimpleArray<int> iArray;

// Create an array of char pointers
// and use a new equality function
CSimpleArray<char *, MyEqualityEqualHelper<char *> > cMyArray;   

Community Additions

© 2015 Microsoft