Inline functions vs Preprocessor macros

后端 未结 14 2142
一个人的身影
一个人的身影 2020-11-22 12:37

How does an inline function differ from a preprocessor macro?

14条回答
  •  忘了有多久
    2020-11-22 13:36

    A inline functuion behaves syntactically just like a normal function, providing type safety and a scope for function local variables and access to class-members if it is a method. Also when calling inline methods you must adhere to private/protected restrictions.

提交回复
热议问题