Serialization of intrusive_ptr's?
Hey, quick question, what do I need to do to serialize intrusive_ptr's? I don't see anything in the serialization documentation to indicate that it supports it, does it? If not, is there an easy way? Or do I need to serialize the raw pointers and re-construct the intrusive_ptr's one by one? I'm storing intrusive_ptr's inside std container classes(map, list). Thanks, Jared
Anyone know or have any tips on this? Should I just get the raw
pointer out of all of my intrusive_ptrs and serialize that? Or can I
just archive a std container with intrusive ptrs?
Thanks, Jared
On Sat, Apr 18, 2009 at 8:40 AM, Jared Lee Richardson
Hey, quick question, what do I need to do to serialize intrusive_ptr's? I don't see anything in the serialization documentation to indicate that it supports it, does it? If not, is there an easy way? Or do I need to serialize the raw pointers and re-construct the intrusive_ptr's one by one? I'm storing intrusive_ptr's inside std container classes(map, list).
Thanks, Jared
Jared Lee Richardson:
Anyone know or have any tips on this? Should I just get the raw pointer out of all of my intrusive_ptrs and serialize that? Or can I just archive a std container with intrusive ptrs?
I think that if you take boost/serialization/scoped_ptr.hpp and replace scoped_ptr with intrusive_ptr, the result should "just work" because of Boost.Serialization's raw pointer tracking. But I haven't actually tried. :-)
participants (2)
-
Jared Lee Richardson
-
Peter Dimov