Subject: [Boost-users] [Serialization] Is this example legal usage of the serialization library
From: Elizabeta (elizabeta.petreska_at_[hidden])
Date: 2010-08-26 10:48:23


Hi,

Is it ok to serialize/deserialize in the object I get when dereference a
pointer ?

void f()
{

    B* bObj=new B();

     /// save
     {
        std::ofstream ofs("C:\\hh.txt");
         boost::archive::xml_oarchive oa(ofs);
         oa & make_nvp("bObj",*bObj);
     }
     //// Load
     {
         std::ifstream ifs("C:\\hh.txt");

         boost::archive::xml_iarchive ia(ifs);
         ia & make_nvp("bObj",*bObj);
     }
}

My second question :
Is it ok to serialize/deserialize in *this ?

Thanks