There's two things about inlining:
- The
inline
keyword will be ignored if the compiler determines that the function cannot be inlined. - There is a compiler optimization (on Visual Studio, I don't know about GCC) that tells the compiler to inline all functions where possible.
From this I conclude that I never need to bother about inlining. I just have to turn on the compiler optimization for the release build.
Or are there any situations where manually inlining would be preferred?
See Question&Answers more detail:os