C/C++ keyword: inline

By declaring a function inline, you can direct GCC to make calls to that function faster. One way GCC can achieve this is to integrate that function's code into the code for its callers. This makes execution faster by eliminating the function-call overhead.

Yeah, the reason why we like using inline is to improve the performance of our programme.

However, you should know that we inline is a suggestion to the complier, so the final results is up to the complier.

When you define a function in class, this function is the candidate inline function whose performance may be improved.

你可能感兴趣的:(c++,c语言)