【发布时间】:2011-08-31 08:29:30
【问题描述】:
类中的 C++ 中的 Operator= 声明如下:
MyType & operator=(const MyType & rhs);
原因是链接是必要的。但是,由于 operator= 具有正确的优先级,因此返回值就足够了。
【问题讨论】:
-
问题写在question-title中:Why I can't define operator= with non-reference return type?
-
@George:问题标题是个问题……
标签: c++ operators operator-overloading operator-precedence