This:
CArray <SomeClass> collection;
is equivalent to this:
CArray <SomeClass, const SomeClass&> collection;
The second template parameter is used to specify the type through which members are accessed. The template parameters are described in the documentation on MSDN.
This:
CArray <SomeClass* ,SomeClass* > collection;
stores a collection of pointers to objects of type SomeClass
, whereas the other two store collections of objects of type SomeClass
.
As for why you "shouldn't use it," std::vector
, which is part of the C++ language standard, and thus portable, is probably a better choice for most projects. If you have legacy code that uses CArray
, then you may need to use it, and there's nothing wrong with that.