Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] Sending user data to serialize()?
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-02-04 16:20:04


Probably trying to solve the wrong problem. Anyway try this:

    template< typename Archive >
    void A::save( Archive& archive, unsigned int ) const
    {
        archive & m_listOfB;
        ar << m_listOfB.size();
        for(i = 0; i < s; ++i)
            ar << m_listOfB[i]
    }
    template< typename Archive >
    void A::load( Archive& archive, unsigned int )
    {
        unsigned int s;
        ar >> s;
        m_listOfB.reserve(s);
        for(i = 0; i < s; ++i)
            ar >> m_listOfB[i];
    }


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