For primitive types, simply return by value. There is no reason to return a primitive by const reference.
For non-primitive types, it depends.
If the value returned is a local variable of the function, then you must return by value. Otherwise, the variable will be destroyed before the caller can consume the returned reference.
If the value returned is a class data member, then you have a choice.
Return by const reference avoids copies, which may be a performance advantage. However, it ties your interface to the implementation, i.e. the data member and return value must be the same type. It is also less safe because the caller can retain the reference longer than the object's lifetime, such as:
const X& x = y->foo();
delete y;
// use x, oops!
Return by value incurs one or two copies, depending on if you can take advantage of return value optimizations (which is likely for simple get() methods such as this). In addition, copies of objects using default copy constructors may be copied more efficiently (think: the compiler can simply memcpy the data).
Recommendation: start with return by value, and switch to return by const reference only after determining that that call/copy is known to be a performance issue.
Finally, another alternative is to return by parameter, which can be useful for more complex objects (e.g., string):
void foo(X& return_val) { return_val = member_variable_; }
or:
void foo(X* return_val) {
assert(return_val != 0);
*return_val = member_variable_;
}