Daniel,now it is clear. I didn't and still don't understand exactly how internal data members are represented in the generated class (I have no access to my code now) but the situation I have by returning a reference is clear. BTW does it make sense to think about shared_ptr as returned value for getter?