C++ inline functions // How to optimize your functions
ฝัง
- เผยแพร่เมื่อ 21 ต.ค. 2020
- By using inline functions (methods) in your program, you may be able to get the compiler to eliminate your function calls, and therefore, the overhead and time it takes to execute those function calls. This leaves you with the instructions of the function without the time it takes to call the function.
All we need is the inline keyword (or not).
We'll start out with a little theory and then I'll show you a sample program.
// Learn More //
Check out my complete C++ videos playlist:
• Playlist
Check out my C++ Classes playlist:
• Playlist
Check out my C++ functions playlist:
• Playlist
"Keep calm & Love programming!" Thanks!!!!
Most of the time the modern compilers automatically do the inlining of functions. The main effect of the inline statement is that it suspends the one-definition rule for that function.
Thanks for the comment!
Great explanation!
Thanks for the comment, really appreciate it.
Thanks for your efforts.
Thanks professor Hank, great explanation!
Hi, Spongebob. Thank you tons for your comment. Love your show. 👍