A normal function call would involve stack operations and processor to shift to the first instruction in the function definition which might take significant time. For small functions with one or two lines this time is unnecessary. Such functions can be declared as inline functions using the keyword inline. In general, inline functions are faster than normal functions. When the compiler comes across a call to a inline function, it directly substitutes the function definition in the place of function which might increase the size of code. So, the use of inline keyword in programs should be minimal. Consider
The post What is the use of inline functions in c++ programming appeared first on Coding Security.
What is the use of inline functions in c++ programming
read more
Tidak ada komentar:
Posting Komentar