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

后端 未结 9 1514
故里飘歌
故里飘歌 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:37

    Yes, the compiler has the final decision. In VS you can even inline recursive functions into specified depth ;)

    #pragma inline_depth( [0... 255] )
    

提交回复
热议问题