friend AND inline method, what's the point ?

后端 未结 3 1912

I see in a header that I didn\'t write myself the following:

class MonitorObjectString: public MonitorObject {
   // some other declarations
   friend inlin         


        
3条回答
  •  北海茫月
    2020-11-30 02:53

    They aren't mutually exclusive. "friend" means the non-member function can access the private members of the class. "inline" means there is no function call invocation, the body of the function is duplicated (in assembly) at every call site.

提交回复
热议问题