When do compilers inline C++ code?

前端 未结 11 1183
孤独总比滥情好
孤独总比滥情好 2020-11-29 08:07

In C++, do methods only get inlined if they are explicitly declared inline (or defined in a header file), or are compilers allowed to inline methods as they see

11条回答
  •  长情又很酷
    2020-11-29 09:11

    If I'm not mistaken, when optimizations are turned on, the compiler will inline any suitable routine or method.

提交回复
热议问题