A default argument is checked for type at the time of declaration and evaluated at the time of call.
| One of the major objectives of using functions in a program is to save memory space, which becomes appreciable when a function is likely to be called many times. |
| However, every time a function is called, it takes a lot of extra time in executing tasks such as jumping to the calling function. |
| When a function is small, a substantial percentage of execution time may be spent in such overheads and sometimes maybe the time taken for jumping to the calling function will be greater than the time taken to execute that function. |
|
The compiler may not perform inlining in the following circumstances:
|
|
When to use Inline function?
We can use Inline function as per our needs. Some useful recommendation are mentioned below- 1. We can use the inline function when performance is needed. 2. We can use the inline function over macros. 3. We prefer to use the inline keyword outside the class with the function definition to hide implementation details of the function. A function definition in a class definition is an inline function definition, even without the use of the inline specifier |