When should I write the keyword 'inline' for a function/method?

后端 未结 15 2453
清歌不尽
清歌不尽 2020-11-21 06:55

When should I write the keyword inline for a function/method in C++?

After seeing some answers, some related questions:

  • When should I <

15条回答
  •  礼貌的吻别
    2020-11-21 07:02

    You want to put it in the very beginning, before return type. But most Compilers ignore it. If it's defined, and it has a smaller block of code, most compilers consider it inline anyway.

提交回复
热议问题