Boost logo

Boost Users :

Subject: [Boost-users] Boost deserialization of contained object fails when performed from a constructor, but succeeds otherwise.
From: bhartsb (bhartsb_at_[hidden])
Date: 2009-10-28 18:20:11


E.G.:

ContainingClass::ContainingClass(){

pNA = new objectArray*[NUMBER]; //allocates ptrs

...

pNA[ii] = new objectArray(SIZE);//allocates object array, and object array
has a std::map "PatternsMap"

...

pNA[ii]->load(pNA[ii], "../release/NA Data/NADataa descriptionNA0"); //fails
pNA[ii]->PatternsMap.size(); //size = 0

}

If I call the following lines of code after the constructor exits then all
is well:

pNA[ii]->load(pNA[ii], "../release/NA Data/NADataa descriptionNA0");
//succeeds
pNA[ii]->PatternsMap.size();//size > 0

Any ideas? Note, that in the constructor example I verified that objectArray
was constructed first.

-- 
View this message in context: http://www.nabble.com/Boost-deserialization-of-contained-object-fails-when-performed-from-a-constructor%2C-but-succeeds-otherwise.-tp26102788p26102788.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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