Dante Stroe wrote:
Hello,
I am trying to serialize a vector of pointers (Below you have a piece of dummy code that reproduces the error) but I get compilation errors. As I understood from the tutorial this should pretty much work out of the box. Am I missing something? I am using gcc 4.1 and the 1.43 version of the boost library.
Thanks a lot, Dante
Test program:
#include<cstddef> #include<iomanip> #include<iostream> #include<fstream> #include<vector> #include
#include #include #include #include class test { friend class boost::serialization::access; std::vector
r; // = std::vector (n); template<class Archive> void serialize(Archive& ar, const unsigned int /*file_version*/){ ar& r; } public: test(){}; };
I'm guessing that there is a problem serializing a pointer to a double which is a primitive. This is inhibited as it tends to have undesired side effects. You might try a strong type or serialization of a class which contains nothing but a double. Robert Ramey