CArray processing under CArray

Compile Error:

1>d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxtempl.h(262): error C2248: "CObject::operator=": cannot access private member (in class "CObject" declaration)
1> d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(535) : see declaration of "CObject::operator="
1> d:\program files ( x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h(509) : see declaration of "CObject"
1> This diagnostic appears in the compiler generated function "CArray<TYPE,ARG_TYPE>&CArray<TYPE,ARG_TYPE >::operator = (const CArray<TYPE, ARG_TYPE> &)" in
1> with
1> [
1> TYPE=odb_LayerFeatUnit,
1> ARG_TYPE=odb_LayerFeatUnit &
1> ]

1> ODBDlg.cpp


solve:

Returning a CArray requires a copy constructor,
and CArray is based on CObject.
Forbidden by CObject.
Its copy constructor is private.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325967534&siteId=291194637