Serialization of pointers to PODs

Is it possible using the boost serialization libraries to serialize pointers to PODs, such as integers? I have tested successfully with pointers to classes but have not been able to get pointers to non-polymorphic serialized. Is this a known issue? Joe

Pointers to primitives are not tracked. See implementation level. If you really need to do this, use BOOST_STRONG_TYPEDEF to make a type which is not primitive. Check the documentation regarding serialization traits.
Robert Ramey
"Joseph Fradley"

Thanks, I'll check it out.
On 1/28/08, Robert Ramey
Pointers to primitives are not tracked. See implementation level. If you really need to do this, use BOOST_STRONG_TYPEDEF to make a type which is not primitive. Check the documentation regarding serialization traits.
Robert Ramey
"Joseph Fradley"
wrote in message news:f7907c850801281226ra033ea4tda49655c0964339d@mail.gmail.com... Is it possible using the boost serialization libraries to serialize pointers to PODs, such as integers? I have tested successfully with pointers to classes but have not been able to get pointers to non-polymorphic serialized. Is this a known issue? Joe
------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

"Joseph Fradley"
news:f7907c850801281226ra033ea4tda49655c0964339d@mail.gmail.com... Is it possible using the boost serialization libraries to serialize pointers to PODs, such as integers? I have tested successfully with pointers to classes but have not been able to get pointers to non-polymorphic serialized. Is this a known issue?
Joe
On 1/28/08, Robert Ramey
wrote: Pointers to primitives are not tracked. See implementation level. If you really need to do this, use BOOST_STRONG_TYPEDEF to make a type which is not primitive. Check the documentation regarding serialization traits.
Robert Ramey
On 1/29/08, Joseph Fradley
wrote: Thanks, I'll check it out.
Thanks, that worked. I added a non-intrusive serilaze() function because I didn't want to mess with the macro, below is what I used for 'int' //// BOOST_STRONG_TYPEDEF(int, int_type) // serialize function for int_type namespace boost { namespace serialization { template<class Archive> void serialize(Archive & ar, int_type & g, const unsigned int version) { ar & make_nvp("value", g.t); } } // namespace serialization } // Joe
participants (2)
-
Joseph Fradley
-
Robert Ramey