[serialization] When do I need to overload operators
Hi: In trhe demo.cpp file in the Serialization examples, the << and >> operators are made friends of the gps_position class and are overridden. In what circumstances do I need to override these operators and when can I get away with just writing a Serialize template function. Regards Sean.
Sean Farrow wrote:
Hi:
In trhe demo.cpp file in the Serialization examples, the << and >> operators are made friends of the gps_position class and are overridden. In what circumstances do I need to override these operators and when can I get away with just writing a Serialize template function.
Serialization only involves the serialize template methods. The insertion/extraction operator overloads are only used in the example to be able to print the states to the console for you to verify that serialization worked properly. Jeff
participants (2)
-
Jeff Flinn
-
Sean Farrow