Yes, it is called inlining.
In addition, c++ designed specifically to support or facilitate for the compiler such optimizations in rather complex cases of inheritance and patterns.
Some would say that this is a rather distinctive feat of c++ as a high-level language compared to others. Its "high-level" functions (basically I mean general programming patterns) were developed with such optimizations in mind. This is also one of the reasons that makes it considered effective in terms of performance.
That's why I would expect decent work when developing inline with any reputable compiler.
From what I read, this is also the reason that it is difficult to get all the fancy stuff of other high-level languages, such as the reflection engine, or other well-known from, for example, Java or python. This is due to the fact that c++ makes it easy to embed almost everything possible, so it is difficult to inspect optimized code.
Edit:
Because you said that you are writing OpenGL material, where the performance of setters and getters is important and such optimizations, I decided to figure it out a bit and show a slightly more interesting example where you can rely on the built-in mechanism.
You can write some interfaces, avoiding the virtual mechanism, but using templates. For instance:
//This is a stripped down interface for matrices for physical objects //that have Hamiltonian and you can apply external field and temperature to it template< class Object > class Iface { protected: Object& t; public: Iface(Object& obj) : t(obj) {}; Vector get_eigen_vals() {return t.get_eigen_vals(); }; Matrix get_eigen_vectors() {return t.get_eigen_vectors(); }; void set_H(VectorD vect) { t.set_H(vect); }; void set_temp(double temp) {t.set_temp(temp);}; };
If you declare such an interface, you can wrap the object using this interface object and pass an instance of this interface class to your functions / algorithms, and still have everything inline because it works by reference to the Object . A good compiler optimizes the entire Iface output.