开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜