我有类foo的以下成员.
foo &foo::bar() { return this; }
但我收到编译器错误.我做错了什么蠢事?
编译器错误(gcc):错误:从类型为'foo*const'的临时类中初始化'foo&'类型的非const引用
c++ return reference this
c++ ×1
reference ×1
return ×1
this ×1