Inline function

C ++ provides a way to improve the efficiency of the function, that is, the code of the called function is directly embedded into the calling function at the time of compilation, and this link is canceled. Such a function embedded in the calling function is called an inline function.
The declaration of an inline function is to add an inline modifier before the type of the function definition. The definition form is:

inline 返回类型 函数名(参数列表)
{
	函数体
}

► Loop statements and switch statements are not allowed in inline functions.
► The declaration of the inline function must appear before the first time the inline function is called.
Insert picture description here

Published 19 original articles · Like9 · Visits 2900

Guess you like

Origin blog.csdn.net/u013031697/article/details/104548319