How do you decide which functions must be inline and which are better leaved as-is? When function just returns a member, I have no doubt, but how far can that still result in better performance?
If the function is executed frequently in your program, you may want to make the function inline to eliminate the overhead. Typically, compilers are smart enough to identify functions that execute frequently and compile them inline. It is usually a better idea to let the compiler choose.
Inlining allows the compiler to elide generating instructions to call a function, set up the stack frame, destroy it, and return.
If the amount of code you are executing inside the function is comparable to the above, then inlining will buy you something (if you are calling the function many many times). If the amount of code inside your function dominates the above, then inlining will buy you little.
In order for the compiler to be able to inline a function call, the compiler has to be able to see the body of the function being called.
ie, if you put the definition of the function in a .cpp file, then that function can only be inlined within that .cpp file. If other .cpp files try to call it, it will result in a function call.