C++ inline functions using GCC - why the CALL?

后端 未结 7 669
感动是毒
感动是毒 2020-12-28 17:55

I have been testing inline function calls in C++.

Thread model: win32
gcc version 4.3.3 (4.3.3-tdm-1 mingw32)

Stroustrup in The C++ Program

7条回答
  •  情话喂你
    2020-12-28 18:03

    Inline is nothing more than a suggestion to the compiler that, if it's possible to inline this function then the compiler should consider doing so. Some functions it will inline automatically because they are so simple, and other functions that you suggest it inlines it won't because they are to complex.

    Also, I noticed that you are doing a debug build. I don't actually know, but it's possible that the compiler disables inlining for debug builds because it makes things difficult for the debugger...

提交回复
热议问题