Amit
Answered On : Jan 6th, 2012
Inline function: they are same as Normal function but compiler treat them diffrently. When we call a inline function compiler will replace the call by inline function body (It depends upon how you have made a call).
we can make a request to compiler to treat a function as inline, it up to the compiler whether it use as inline or not.
Advantage: If your inline function is small then, function call overhead can be avoided , so by using inline you can get some better performance.
Login to rate this answer.
The inline keyword is a request to the compiler that you want the function body to be inserted into the compiled code as opposed to a function call. Typically used for functions that are called very ofter and perform a very simple function, e.g size(){ return m_size;}. The advantage is better performance but can lead to large executable size.
Login to rate this answer.