Original Post
Well, maybe someone asked this before, but I couldn't find it on the forums. I've been programming for a good amount of time, but I always had this doubt in my mind. If I declare a class data member as private and use inline get/set methods to access it, will I have performance gains? I mean, in terms of speed, will it be the same as if I declared the data member as public? I always think about that because I have some templated classes for point, vector and matrix and I use inline operators and methods to access the data members. As in my applications speed is required, I always wondered if I should abandon the good programming practices of declaring things private in order to obtain better performance. Thanks all!