关于 this 指针

来源:互联网 发布:tensorflow 图片 编辑:程序博客网 时间:2024/05/18 21:51

在一个函数中想要返回 this 指针,需注意函数的返回值与返回 this 指针的类型是否一致。


this 为 Type *const 类型, 而* this为 Type 类型。


一般在函数使用 * this 来替代调用其的对象。