相关疑难解决方法(0)

在C++中返回"this"?

在Java中,您只需return this获取当前对象即可.你是如何用C++做到的?

Java的:

class MyClass {

    MyClass example() {
        return this;
    }
}
Run Code Online (Sandbox Code Playgroud)

c++ return this

15
推荐指数
2
解决办法
4万
查看次数

标签 统计

c++ ×1

return ×1

this ×1