
Thorsten Ottosen wrote:
class gps_position { public: int degrees; int minutes; float seconds; gps_position(){}; gps_position(int d, int m, float s) : degrees(d), minutes(m), seconds(s) {} };
I think it should be stated that this is not recommended practice, ie, this class has a non-trivial invariant and should not have public members.
I might add a friend rather than use public. But this small code snipet is used to illustrate the non-intrusive serialization - nothing more. BTW
"Robert Ramey" <ramey@rrsd.com> wrote in message news:20040414170207.5A5BB3150A@acme.west.net... the
actual demo programs don't use this. What is the non-trivial invariant here?
I assume that not all data members can have arbitrary values. How many seconds to a minute before the seconds should be reset etc.
Anyway, I'll consider adding some comments to remind the reader of the intended purpose of he tutorial example.
Thanks. br Thorsten