Share via


Control In-line Function Expansion

OverviewDetails

Feature Only in Professional and Enterprise Editions   Code optimization is supported only in Visual C++ Professional and Enterprise Editions. For more information, see .

Controls which functions become expanded. Expanding a function inline makes the program faster because it does not incur the overhead of calling the function.

Disable

 Command line equivalent is the /Ob0 switch.

Only __inline

Command line equivalent is the /Ob1 switch.

Any Suitable

Command line equivalent is the /Ob2 switch.

The compiler treats the inline expansion options and keywords as suggestions. There is no guarantee that functions will be inlined; there is no way to force the compiler to inline a specific function.

You can also use #pragma auto_inline to exclude functions from being considered as candidates for inline expansion.