Inline Functions in C++

Inline Functions in C++

 

Pros
1. Inline Function speed up your program because it avoids the time waste  due to function calling.
2. Inline Function save time waste due to variables push/pop on the stack, when function calling happens.
3. Inline Function save time of return call from a function.
4. Inline Function increases locality of reference by utilizing instruction cache.
Cons 
1. When we inline the function, it is resolved at compile time. So, we can say that if you change the code of the inline function, then it is necessary to recompile all the program to make sure that it is updated.

Latest posts by Prof. Fazal Rehman Shamil (see all)

Buy advertisement space on T4Tutorials

For more details email [email protected]