Boost logo

Boost Users :

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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net