Benefits of inline functions in C++?

后端 未结 14 1392
终归单人心
终归单人心 2020-11-22 05:30

What is the advantages/disadvantages of using inline functions in C++? I see that it only increases performance for the code that the compiler outputs, but with today\'s opt

14条回答
  •  抹茶落季
    2020-11-22 06:04

    During optimization many compilers will inline functions even if you didn't mark them. You generally only need to mark functions as inline if you know something the compiler doesn't, as it can usually make the correct decision itself.

提交回复
热议问题