|
|
|
|
|
|
k****y 发帖数: 781 | 1 void Textbox :: operator = (TextBox &source) {
if (this==&source) return;
Rect:: operator = (source );
textColor = source.textcolor;
}
Rect:: operator = (source );这句的含义,难道不要写成 a=b的形式? | k****f 发帖数: 3794 | 2 要求调用父类Rect的operator =,
【在 k****y 的大作中提到】 : void Textbox :: operator = (TextBox &source) { : if (this==&source) return; : : Rect:: operator = (source ); : textColor = source.textcolor; : : } : Rect:: operator = (source );这句的含义,难道不要写成 a=b的形式?
| k****y 发帖数: 781 | 3 是不是应该写成
*(Rect*)this = *(Rect*)&source; | p*u 发帖数: 2454 | 4 no need, and yours has type safety problem.
【在 k****y 的大作中提到】 : 是不是应该写成 : *(Rect*)this = *(Rect*)&source;
|
|
|
|
|
|
|