[serialization] how for a particular object to get ID that is assigned by the lib

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 !!! }

I wouldn't know how to do this. The object ID is managed internally by the library and not part of the public interface. I considered asking why one might want to do this, but decided against it. Robert Ramey.
participants (2)
-
Ivan
-
Robert Ramey