Should one never use static inline function?

后端 未结 5 1426
暗喜
暗喜 2020-12-07 08:10

There are two implications of using the inline keyword(§ 7.1.3/4):

  1. It hints the compiler that substitution of function body at the point
5条回答
  •  无人及你
    2020-12-07 09:02

    I just read a man page for gcc and it specifically states the use of static inline with a compiler flag. In the case of the flag, it inlines the function and if it is also static and is inlined in every instance that it is called, then it gets rid of the function definition which will never be used in the created object file, thereby reducing the size of the generated code by that little bit.

提交回复
热议问题