C++: Performance impact of BIG classes (with a lot of code)

前端 未结 9 1988
执念已碎
执念已碎 2021-01-17 15:08

I wonder if and how writing \"almighty\" classes in c++ actually impacts performance.

If I have for example, a class Point, with only uint x

9条回答
  •  感情败类
    2021-01-17 15:29

    You have already got some pretty good technical advice. I want to throw in something non-technical: As the STL showed us all, doing it all in member functions might not be the best way to do this. Rather than piling up arguments, I refer to Scott Meyers' class article on the subject: How Non-Member Functions Improve Encapsulation.

    Although technically there should be no problem, you still might want to review your design from a design POV.

提交回复
热议问题