What does the '&' means in a Unary Operator of a Class?
class 开发者_开发百科CDate
{
// some declarations
public:
CDate& operator ++ ()
{
// increment function;
return *this;
}
};
Does the '&' mean a reference that is being a return?
Thanks
SpecC
Yes, you answered your own question. CDate &
simply means that the operator returns a reference to a CDate
object. It has no special meaning because it's an operator, it means the same in any other function.
精彩评论