When is “inline” ineffective? (in C)

前端 未结 12 654
鱼传尺愫
鱼传尺愫 2020-12-09 10:56

Some people love using inline keyword in C, and put big functions in headers. When do you consider this to be ineffective? I consider it s

12条回答
  •  青春惊慌失措
    2020-12-09 11:43

    Inline is effective in one case: when you've got a performance problem, ran your profiler with real data, and found the function call overhead for some small functions to be significant.

    Outside of that, I can't imagine why you'd use it.

提交回复
热议问题