Question about CArray.
-
My code like this: CUIntArray CMyClass::CMyFunc(CUIntArray caArrayA, CUIntArray caArrayB) { return m_ncaBinaryResult; } CMyClass derived from CObject. CUintArray is almost same as CArray, but only contain UINT elements. I got "class 'CUIntArray' : no copy constructor available" compile error at the 'return m_ncaBinaryResult'. How to fix it. Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)
-
My code like this: CUIntArray CMyClass::CMyFunc(CUIntArray caArrayA, CUIntArray caArrayB) { return m_ncaBinaryResult; } CMyClass derived from CObject. CUintArray is almost same as CArray, but only contain UINT elements. I got "class 'CUIntArray' : no copy constructor available" compile error at the 'return m_ncaBinaryResult'. How to fix it. Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)
Pass the arguments as const references - it's much more efficient, since compiler doesn't need to create copies of arguments. You should also avoid returning objects like CArray by value - rather, pass 3rd argument as non-const reference. Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
-
Pass the arguments as const references - it's much more efficient, since compiler doesn't need to create copies of arguments. You should also avoid returning objects like CArray by value - rather, pass 3rd argument as non-const reference. Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***