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

ความคิดเห็น • 8

  • @liboyan7010
    @liboyan7010 ปีที่แล้ว

    "Keep calm & Love programming!" Thanks!!!!

  • @janosszabo9251
    @janosszabo9251 3 ปีที่แล้ว +4

    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.

  • @patrickkrenz515
    @patrickkrenz515 2 ปีที่แล้ว +3

    Great explanation!

  • @rawdhatul_fawaid
    @rawdhatul_fawaid ปีที่แล้ว +1

    Thanks for your efforts.

  • @spongebobsquarepants4576
    @spongebobsquarepants4576 ปีที่แล้ว

    Thanks professor Hank, great explanation!

    • @ProfessorHankStalica
      @ProfessorHankStalica  ปีที่แล้ว

      Hi, Spongebob. Thank you tons for your comment. Love your show. 👍