- #1
neurocomp2003
- 1,366
- 4
Just curious if there was any difference between the following two set-variable style functions for member variables interms of effiecieny
CType& Member(void) {return _member; } //Used in David Eberly's Code
void Member(CType const& tp) {_member=tp); }
Is there an actual difference?
Also is it better to have public variables for classes that are used constantly like a vector._x or to have them as vector.x()
Heh i should really go to coding forums for this but I've never really used a C/C++ Coding forum before. Maybe i'll go browse gamedev
CType& Member(void) {return _member; } //Used in David Eberly's Code
void Member(CType const& tp) {_member=tp); }
Is there an actual difference?
Also is it better to have public variables for classes that are used constantly like a vector._x or to have them as vector.x()
Heh i should really go to coding forums for this but I've never really used a C/C++ Coding forum before. Maybe i'll go browse gamedev