This is a protection :) :
private:
CObject(const CObject& objectSrc);
...while the
CArray
class has not a copy constructor.
Why is it a "protection" ?
CArray
do not know how its members must be copied, and
CObject
(base) as well... :)
So, for example, the code:
{
CArray<CString>* pArray(new CArray<CString>);
pArray->Add(_T("One"));
pArray->Add(_T("Two"));
CArray<CString> arTest(*pArray);
delete pArray;
pArray = NULL;
TCHAR tchTest(arTest[0].GetAt(1) + arTest[1].GetAt(2));
}
... may provide a crash at its last line :)