In the following program body cosists of a vector of pointers. Points is a struct of x,y,z coordinates and a point_id. I believe as body is passed by const reference, the fo
This is one of best example which shows why data members should not be public.
here, body is constant hence its data members must not be changed, but in body.bp[0]->points point is being changed which is not the member of Body.Hence no const violation.