When should I use __forceinline instead of inline?
Visual Studio includes support for __forceinline. The Microsoft Visual Studio 2005 documentation states: The __forceinline keyword overrides the cost/benefit analysis and relies on the judgment of the programmer instead. This raises the question: When is the compiler's cost/benefit analysis wrong? And, how am I supposed to know that it's wrong? In what scenario is it assumed that I know better than my compiler on this issue? The compiler is making its decisions based on static code analysis, whereas if you profile as don says, you are carrying out a dynamic analysis that can be much farther