Search:
Forum
General C++ Programming
Question on serialization boost tutorial
Question on serialization boost tutorial
Feb 24, 2020 at 11:54pm UTC
Hanske
(76)
Hey everyone, just a quick question. I'm learning boost serialization (and also improving my c++ skills) and wanted to know why in the boost tutorial:
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
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)
{}
};
why is gps_position(){}; defined beforehand? Why not just delete that line?
Tutorial:
https://www.boost.org/doc/libs/1_72_0/libs/serialization/doc/index.html
Under Nonintrusive Version
Feb 25, 2020 at 12:39am UTC
helios
(17574)
I'm guessing Boost.Serialization needs a default constructor to do its thing.
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs