C++ = "inline function"

inline function

The main advantage of inline functions is to increase the efficiency of the program.

Precautions

When using inline functions, pay attention to:
1. Recursive functions cannot be defined as inline functions
2. Inline functions are generally suitable for small functions that do not have complex structures such as while and switch and only have 1 to 5 statements, otherwise compile The system treats the function as a normal function.
3. Inline functions can only be used after they are defined , otherwise the compilation system will consider them as ordinary functions.
4. No exception interface declaration is allowed for inline functions.

Note: from Baidu Encyclopedia

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324716454&siteId=291194637