This is a rather old topic: Are setters and getters good or evil?
My question here is: do compilers in C++ / D / Java inline the getters and setter?
To which
In C++, when a compiler's optimizations are enabled then getters and setters may be 'inlined': i.e., be implemented using the same machine instructions as there would be for direct access to the underlying member data.