inline function内联函数
macro宏
You should use an inline function when you wish to optimize function calls. You may consider an inline function as a macro that copies the function contents (inline) to code segment where the function is called. However, inline function is very different from a macro (google it up). Some major differences:
- Inline function is type safe
- It is up to the compiler to choose to inline the inline function or not
- Expression passed to inline functions are evaluated exactly once
Functions defined in the class definition are also inline although there is no explicit inline directive.