1. For example:
1 int g (int23 return x +4 56int7 8 return9
1 int 23 return x +4
Now the compiler will automatically decide whether to do the above for the function, instead of adding inline to the previous one. That is, inline functions are typically used only when the content of the function is very simple, because the code of the inline function expands wherever it is called, and if the function is too complex, the consequences of code bloat are likely to outweigh the benefits of increased efficiency. The most important place to use the inline function is the access function for the class.
A function can only be defined once in a CPP file of an executable file. If you define a function in a. h file and have two CPP included, it will cause the function to be defined in two CPP to produce an error. But the inline function is allowed to be defined more than once in multiple CPP, which solves the problem.
Attached: Baidu Library Inline (http://baike.baidu.com/link?url=ht_ B0VB9EEBXNSR9JQ8DM6K1OZMAP-HO3IWPHJFLI2ABVSIPULIUOPBKWOIBXPK1DRK8SJGM7IZN_L2C516G5Q), in more detail.
What is the difference between the inline function and the general function