[serialization] Storing something that could be primitive or non-default constructable.

template < typename T > struct storing { storing(T const& t) : val(t) {} T val; }; namespace boost { namespace serialization { template < typename Archive, typename T > void save_construct_data(Archive & ar, storing<T> const* ptr, unsigned int const) { // what to put here? } template < typename Archive, typename T > void load_construct_data(Archive & ar, storing<T> * ptr, unsigned int const) { // what here? } }} If I try to store val as a pointer then I can't instantiate with anything serialization considers "primitive". For instance, if I try to serialize a storingstd::string then I'll get errors about std::string not having a serialization routine even if I include boost/serialization/string.hpp. If I try to load into a temporary variable then I run into the problem of having to construct one, and sometimes I need extra information to do so (I have the serialization routines dealing with this in such cases). Any ideas?
participants (1)
-
Noah Roberts