
10 Aug
2010
10 Aug
'10
3:11 a.m.
AMDG OvermindDL1 wrote:
On Mon, Aug 9, 2010 at 7:43 PM, gmkdroid <gmkdroid@gmail.com> wrote:
Here's an example of the issue I'm having:
*MyObject.h*
////////////////////////////////////////////////////////////////////////////////////// #include <boost/serialization/access.hpp> class CMyObject { public: friend class boost::serialization::access; CMyObject(void) : m_nPrivateData(123) { } ~CMyObject(void) { } private: int m_nPrivateData; };
Your friend class boost::serialization::access; is in the public section, put it in the private section then it can access the private data.
public vs. private doesn't affect friend declarations. In Christ, Steven Watanabe