文件名称:inline
介绍说明--下载内容均来自于网络,请自行研究使用
inlineinline 一、inline 关键字用来定义一个类的内联函数,引入它的主要原因是用它替代C中表达式形式的宏定义。
表达式形式的宏定义一例:
#define ExpressionName(Var1,Var2) ((Var1)+(Var2))*((Var1)-(Var2))
为什么要取代这种形式呢,且听我道来:
1. 首先谈一下在C中使用这种形式宏定义的原因,C语言是一个效率很高的语言,这种宏定义在形式及使用上像一个函数,但它使用预处理器实现,没有了参数压栈,代码生成 等一系列的操作,因此,效率很高,这是它在C中被使用的一个主要原因。
-inlineinline 1, inline keyword is used to define a class inline functions, the introduction of the main reasons it is used instead of C macro definitions in the form of expression. Expression forms one example macro definition:# define ExpressionName (Var1, Var2) ((Var1)+ (Var2 ))*(( Var1)- (Var2)) Why is this form to replace it, Let me show Road to: 1 . Let me first explain the use of this form in the C macro definition because, C language is a very efficient language, this macro is defined in the form and use as a function, but it uses the pre-processor, without the pressure parameters stack, code generation and a series of operations, therefore, very efficient, which it is used in C, a major cause.
表达式形式的宏定义一例:
#define ExpressionName(Var1,Var2) ((Var1)+(Var2))*((Var1)-(Var2))
为什么要取代这种形式呢,且听我道来:
1. 首先谈一下在C中使用这种形式宏定义的原因,C语言是一个效率很高的语言,这种宏定义在形式及使用上像一个函数,但它使用预处理器实现,没有了参数压栈,代码生成 等一系列的操作,因此,效率很高,这是它在C中被使用的一个主要原因。
-inlineinline 1, inline keyword is used to define a class inline functions, the introduction of the main reasons it is used instead of C macro definitions in the form of expression. Expression forms one example macro definition:# define ExpressionName (Var1, Var2) ((Var1)+ (Var2 ))*(( Var1)- (Var2)) Why is this form to replace it, Let me show Road to: 1 . Let me first explain the use of this form in the C macro definition because, C language is a very efficient language, this macro is defined in the form and use as a function, but it uses the pre-processor, without the pressure parameters stack, code generation and a series of operations, therefore, very efficient, which it is used in C, a major cause.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
inline.doc