ProAnswers.org

What are inline functions in c++?

1 Like

An inline function is a function which gets textually inserted by the compiler, much like a macro.
Like macros, performance is improved by avoiding the overhead of the call itself, and (especially!) by the compiler being able to optimize through the call (procedural integration'). Unlike macros, arguments to inline fns are always evaluated exactly once, so thecall’ is semantically like a regular function call only faster. Also unlike macros, argument types are checked and necessary conversions are performed correctly.