
On Thu, Aug 5, 2010 at 8:03 PM, Stefan van Kessel <van_kessel@freenet.de>wrote:
I'm afraid declaring boost::serialization::access a friend is only helpful if you choose the intrusive approach and your serialize member function is not public. If you need the members to be non-public and a "non-intrusive" approach, it seems you have to use a workaround like a derived "accessor class" that exposes the private members. See http://stackoverflow.com/questions/1687579/boost-serialization-access-to-pro... an example.
Have a nice day, Stefan
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Stefan, Thanks for the response. Unfortunately, I think the workaround from stackoverflow would only allow me to access protected members -- not private ones. I did come up with another option that seems to be working for me. I created a save_handler(xml_oarchive& oa, const CMyObject& rObj, const unsigned int version) and load_handler(xml_iarchive& ia, CMyObject& rObj, const unsigned int version) function. I gave these two functions friend access to my class being serialized so they have access to the private members. I have the split/free functions, boost::serialization::save() and boost::serialization::load(), call my handler functions to do the actual serialization. Glen