Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] Non-default constructor and template class
From: Mccall, Kurt E. (JSC-EG411) (kurt.e.mccall_at_[hidden])
Date: 2015-06-15 16:11:55



> you should be able to simply define a private default constructor, if boost::serialization::acess is declared as a friend of your class. There is no need to initialize variables
> that are in your serialize() function, as Boost.Serialization should set > their values after default construction. So in most cases the default constructor may be empty and
> is trivial to implement, while it can not be called by any external entity (except if it is also declared „friend“).

Thanks Beet,

That makes it sound like overriding load_construct_data() and save_construct_data() is almost never necessary. In what cases would it be needed?

Kurt





Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net