[疑难] opAssign ?????

player7 2007-04-25
class AAA{
AAA opAssign(AAA a){ this.c=a.c; return this;}

private:
int c;
}

编译通不过....
r1.d(13): function r1.AAA.opAssign identity assignment operator overload is illegal

oldrev 2007-04-25
右值不能为左值的类型,可以隐式转换的也不行
xgene 2007-06-15
不懂"右值" 和 "左值",请高手讲解一下!!!
ideage 2007-06-15
顾名思义,就是表达式 两侧,分左右.

看看编译原理.
Global site tag (gtag.js) - Google Analytics