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

后端 未结 7 634
感动是毒
感动是毒 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:19

    There is no generic C++ way to FORCE the compiler to create inline functions. Note the word 'hint' in the text you quoted - the compiler is not obliged to listen to you.

    If you really, absolutely have to make something be in-line, you'll need a compiler specific keyword, OR you'll need to use macros instead of functions.

    EDIT: njsf gives the proper gcc keyword in his response.

    0 讨论(0)
提交回复
热议问题