Defined:
There is the structure of the function, but not the nature of the function, similar to macro substitution. The use of inline definitions in code can form inline functions, as well as the specific processing of the compiler's definition within the body of the inner function.
The resulting motive:
Eliminate the overhead of function calls, which are suitable for functions that are frequently executed with small memory functions.
Precautions:
You cannot use a loop statement; You cannot use a switch statement; You cannot use recursive calls; it is defined before the first call;
Issues that are used in combination:
Static inline Fun_returntype fun_name (param ...) {}
Static identity This inline function can only be used in this file, limiting the scope of the inline function. In contrast to macro, static inline has the same level of overhead as macros, and it also provides type safety without the specific limitations of length and format. Here is where the last project was used to put inline functions and macros in the same header file if the call is not much, can be written in the M file extension read http://wenku.baidu.com/link?url=enUimDBZgOWlcThiy_RePb-HY9rFy Czf-ngxgryaydqg2bl9jr9c3hsc3x3-y64t7mhjtgej0qeoqchqdxfqpsklrrgmrirygl2e7bjg-yi http://wenku.baidu.com/view/ 43d2cc1d7cd184254b3535dd.html?re=view
The application of inline function in iOS--Huang Renbin