Is there any overhead using this-> for accessing a member?

前端 未结 5 1050
死守一世寂寞
死守一世寂寞 2021-01-11 17:33

When accessing a member of some class, I can use e.g.:

this->myVar = 10 

or I can just write:

myVar = 10
5条回答
  •  悲&欢浪女
    2021-01-11 18:20

    There is no overhead. The compiler will generate the exact same code for both versions.

提交回复
热议问题