Usefulness of the “inline” feature

前端 未结 8 1301
难免孤独
难免孤独 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:07

    Yes, if you want to put a function in a header file, and include that file in several translation units. This is in fact the main purpose of inline in C++.

提交回复
热议问题