effective C ++ 条款10 operator= 返回一个reference to *this

int x,y,z;

x = y = z = 15;

 

class Widget{

public:

  ...

Wdiget& operator = (const Widget &rhs){

  return *this;

}

}

 

posted on 2020-09-23 23:02  123_123  阅读(112)  评论(0编辑  收藏  举报