C++ built-in functions

Built-in function (inline function):

    1. Before the function call, the process control should note the location of the instruction executed at that time, and also protect the scene (note the relevant information at that time), so as to continue execution after the function call. After the function call, the flow returns to the previously noted location, "restores the scene" based on the noted information, and continues execution. These processes all take time. If some functions need to be used frequently, the time used will be more, thus reducing the execution efficiency.

    C++ provides a way to improve efficiency, that is, the code of the called function is directly embedded into the calling function at compile time, instead of transferring the process out. This kind of function embedded in the calling function becomes a built-in function.

    2, Built-in function: Just add a keyword inline at the left end of the first line of the function.

Guess you like

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