Usefulness of the “inline” feature

前端 未结 8 1293
难免孤独
难免孤独 2020-12-06 14:40

There\'s two things about inlining:

  • The inline keyword will be ignored if the compiler determines that the function cannot be inlined.
  • Th
相关标签:
8条回答
  • 2020-12-06 15:13

    You may not want to inline everywhere it is possible. This could increase the size of your binaries too much. You may have a select few functions that aren't used very much that inlining would allow to run faster without increasing the size of your bits significantly

    0 讨论(0)
  • 2020-12-06 15:18

    Manual use of inline might be useful on older compilers or less sophisticated compilers (such as compilers for embedded development). If you're using visual studio, I don't think you typically need to use the inline keyword at all.

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