|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2005-11-11 12:35:56
The concept of namespace isn't really applicable to member functions.
Member functions are invoked the syntax.
object.member_function(...)
The member function will be invoked regardless of the namespace
the object might have been delcared in.
non-member functions behave according to namespace rules
as you expect.
Robert Ramey
Merrill Cornish wrote:
> 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