对于所有形式的赋值运算,返回对*this指针的引用总是对的,没什么好说的,实现连续赋值x = y = z = 10。 class A { private: int x; int y; int z; public: A& operator=(const A& rhs) //标准形式的赋值操作 { …… return* this; } A& operator+=(int rhs) //非标准形式的赋值操作 { …… return* this; } 杜鹏 2012-08-23 赞微海报分享
近期评论