|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
/Ob (Inline Function Expansion)
Controls inline expansion of functions.
Disables inline expansion, which is on by default.
Expands only functions marked asor __inline or, in a C++ member function, defined within a class declaration.
Expands functions marked as inline or __inline and any other function that the compiler chooses (expansion occurs at the compiler's discretion, often referred to as auto-inlining).
/Ob2 is in effect whenor is used.
This option requires that you enable optimizations using /O1, /O2, /Ox, or /Og.
The compiler treats the inline expansion options and keywords as suggestions. There is no guarantee that functions will be expanded inline. You cannot force the compiler to inline a particular function.
You can also useto exclude functions from being considered as candidates for inline expansion. Also see .
Information that is gathered from profiling test runs will override optimizations that would otherwise be in effect if you specify /Ob, /Os, or /Ot. For more information,.
To set this compiler option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see.
Click the C/C++ folder.
Click the Optimization property page.
Modify the Inline Function Expansion property.
To set this compiler option programmatically