what compiler are you running? which version of boost are you running? do the tests/examples run on your system? what do the warnings say? I would think what you've done below should work. Robert Ramey Lucas Meijer wrote:
Hey,
I've been banging my head against the wall for hours on this one. I'd like to serialize stl containers to an archive. Starting simple: a vector<int>
This is what I think I should do:
1) include the proper support header file for the to be serialized container.
#include
2) create an archive, can be any type:
std::stringstream ss; boost::archive::text_oarchive oa(ss);
3) operator<< my container into this archive:
const vector<int> myvec; oa << myvec;
The "oa << myvec" generates lots of warnings, and when running it anyway, it crashes in smart_cast.hpp
I've tried lots of containertypes, and creating them in other ways than shown above, using a binary_oarchive, but it doesn't seem to make a difference.
(int myint; oa << myint; works fine)
Does anybody see what I'm missing here?
Thanks, Lucas