- Inline functions help to avoid the performance overhead associated with function calling when there are too many calls to a really small function.
- Code of an inline function would be inserted at every point of function call by the compiler.
- Adding the keyword inline is just an instruction to the compiler and there is no guarnatee.
- Inline functions are similar to #define but they have better type checking.
- If the function is defined within the class declaration and it is small the compiler may automatically decide to make the function inline.
EXAMPLE: Demonstrate the usage of inline functions
0 comments:
Post a Comment