Boost logo

Boost Users :

From: Stathis (stathis_at_[hidden])
Date: 2007-12-01 02:21:47


Hi,

What is the right way to serialize/deserialize a container of pointers, e.g. std::vector< int* > ?
I want to store the values, not the addresses in this case. Should I just flatten my data and store
it in a different fashion, then read the flat data and build my objects with a builder?

I ended up storing the size of the container in a separate variable before the data, when
serializing. Then when deserializing, I use this size value to scale the container, create new ints,
read their individual values via the deserialized data values and finally store them back to the new
object. Can you give an example of how to do this better?

cheers,
--stathis


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