how to serialize a const class_name *object
hi all, Am new to boost serialization concept. here i want to serialize these classes please help me to do this; i tried doing this but am gettin some compile time errors while serializing the object1, Please help me to do this, Boost version am using: 1_36_0 c++ compiler: GCC 4.1.1 (gnu-gcc-4.1.1-binutils-2.16.1/x86_64-pc-linux2.4/bin/gcc) Please help me to solve this simple concept.. Thanks in advance, Nina struct mystruct { const char * name; const char * name2; int number; } class my_class { private: const mustruct * object1 }
It would be pretty tough to de-serialize a pointer to a const since
serialization has to change the thing being pointed to.
Try
struct mystruct
{
/*const*/ char * name;
/*const*/ char * name2;
int number;
}
class my_class
{
friend class boost::serialization::access;
private:
const mustruct * object1
}
Also, a closer reading of the documentation might be helpful.
Robert Ramey
"niranjan bangera"
participants (2)
-
niranjan bangera
-
Robert Ramey