What is the meaning of & in c++?

前端 未结 6 775
走了就别回头了
走了就别回头了 2020-12-03 16:50

I want to know the meaning of & in the example below:

class1 &class1::instance(){

///something to do

}
6条回答
  •  自闭症患者
    2020-12-03 17:21

    In the context of the statement it looks like it would be returning a reference to the class in which is was defined. I suspect in the "Do Stuff" section is a

    return *this;
    

提交回复
热议问题