Cpp: Inline Functions 3

Advantages:

* When we use the inline functions, it saves the extra time taken by the call of the function.

* When there is a function call in the source file, the actual code from the function would be inserted , instead of a jump to the function.

* Eliminates the cost of calls to small functions.

* Overhead of a function call and return is eliminated.

* Inline functions improve performance by avoiding the overhead of the call itself.

* Inline functions avoid macro errors since inline function always evaluate every argument exactly once.

* Necessary conversions are performed correctly.

* Arguments types are checked.

* Speed benefit (inline expansion makes a program run faster).

Disadvantages

* Functions grow in size.

* If the functions are not small enough , then at this point the overhead of the function call becomes small compared to the execution of the function.

* Inline functions make the program to take up more memory because the statements that define the inline functions are reproduced at each point where the function is called.

* Trade-off becomes necessary.