
17 Aug
2005
17 Aug
'05
5:42 p.m.
Hi, How could I determine the objectID of an object after it's been saved? I mean the ID that boost::serialization generates for each object at saving. In other words - I know the address of the object and I would like to get its ID after it's been saved. Does anyone know how to do that? Example follows at the end. Ivan #include <boost/archive/text_oarchive.hpp> class A { template<class Archive> void serialize(Archive & ar, const unsigned int version) { ar & i; } public: int i;| }; int main() { std::ofstream ofs("filename"); boost::archive::text_oarchive oa(ofs); A a; a.i = 1; oa & a; // need ID of *a* here !!! }