Does the compiler decide when to inline my functions (in C++)?

后端 未结 9 1513
故里飘歌
故里飘歌 2020-12-06 05:55

I understand you can use the inline keyword or just put a method in a class declaration ala short ctor or a getter method, but does the compiler make the final decision on w

9条回答
  •  青春惊慌失措
    2020-12-06 06:41

    Yes, the final decision of whether or not to inline your code lies in the C++ compiler. The inline keyword is a suggestion, not a requirement.

    Here are some details as to how this decision is processed in the Microsoft C++ Compiler

    • http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx

提交回复
热议问题