Tuesday, October 25, 2005

Mutator - getter functions answered

Let me be very brief. For getters() if they return objects, i mean large objects, it makes sense to return be reference. But most of the times these objects are aggregated prviate members hence best solution that complies with OO semantics as well as provides optimization:

const ClassType& getClassType() const { .....}

All comments are most welcome.

0 Comments:

Post a Comment

<< Home