Inline Specifier

VisualAge C++ provides keywords to specify functions that you want the compiler to inline. By default, function inlining is turned off, and functions qualified with the inline keyword are treated simply as static functions. If an inline function is used across related source files, it must be declared and defined in each source that uses it.

Syntax

 inline function_name() { ( statement )+ };
 (_Inline | _inline | __inline) function_name() { ( statement )+ };

To enable function inlining, specify the opt(inline, ... ) option. When inlining is turned on, the following functions are also considered candidates to be inlined:

Inline specifiers are not recommended to be used:

For example,

 _Inline int LoadThis(int a);

causes LoadThis to be inlined, meaning that code is generated for the function, rather than a function call. The inline keywords also implicitly declare the function as static.



Inlining


Nominate Inline Functions


Optimization Options