
Martin Dietze wrote:
On Sat, April 10, 2010, Robert Ramey wrote:
Just look at boost/serialization/string.hpp and do the same thing for unsigned char
Yes, that was my first thought, too. Consider the code below. Execution fails with this assertion:
a.out: test.cc:47: void load(): Assertion `size == 10' failed. Aborted
This is a little bit tricky. Look carefully at the documentation regarding
BOOST_CLASS_IMPLEMENTATION and try replacing
BOOST_CLASS_IMPLEMENTATION(std::basic_string<unsigned char>,
boost::serialization::primitive_type)
with
BOOST_CLASS_IMPLEMENTATION(std::basic_string<unsigned char>,
boost::serialization::object_type)
(double check "object_type") Basically you want the next level of support
above primitive_type.
Also, consider using
ar & static_cast