Boost logo

Boost Users :

From: Ivan (ivan.rachev_at_[hidden])
Date: 2005-08-17 12:42:40


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.


#include <boost/archive/text_oarchive.hpp>

class A {
    template<class Archive>
    void serialize(Archive & ar, const unsigned int version)
    { ar & i;
     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 !!!

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at