Boost logo

Boost Users :

From: Merrill Cornish (merrill.cornish_at_[hidden])
Date: 2005-11-11 11:44:23


In the Serialization tutorial, and example is given of the "intrusive" method that looks like this:

    private:
        friend class boost::serialization::access;
        template<class Archive>
        void serialize(Archive& ar, const unsigned int version)
        {
            ar& var1;
            ar& var2;
            ar& var3;
        }
 
There is full namespace qualification on "access" but nothing on "serialize()". It appears that serialize() would be in whatever the prevailing application namespace is (which might not be std).

Later in the tutorial there is an example of the "non-intrusive" method that looks like this"

    namespace boost {
    namespace serialization {

        template<class Archive>
        void serialize(Archive& ar, const unsigned int version)
        {
            ar& var1;
            ar& var2;
            ar& var3;
        }

    }//serialization
    }//boost

which implies that serialize() *DOES* need to be namespace qualified.

So, what's really needed?

Merrill


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