Is there any overhead using this-> for accessing a member?
问题 When accessing a member of some class, I can use e.g.: this->myVar = 10 or I can just write: myVar = 10 I like to use this-> because it explicitly declares that the variable is a member of this class, but does it cause any overhead in comparison to just using the variable name by itself? As an alternative I could maybe add a unique prefix to the vars, such as _TmyVar , but I've been using this-> for a long time so I just wondered. 回答1: There is no overhead. The compiler will generate the