我编写了一个perform
复制所有变量值的类的重载赋值运算符。例如:在 Exp.cpp
class perform
{
LOG *ptr;
int a;
//constructor
//destructor
perform operator=(const perform & rhs){
ptr = rhs.ptr; a=rhs.s;
return * this;}
};
在另一个类output
中,我声明了一个指针abc
。
perform * ptr = StatCol::CreateCol(frm);
abc = ptr; //this line should invoke assignment overloaded.
//but in my case it's not invoked.