Boost logo

Boost :

Subject: Re: [boost] [boost.Serialization V1.42.0] Question aboutBOOST_SERIALIZATION_SPLIT_FREE and non-public members
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-08-09 21:55:26


On Mon, Aug 9, 2010 at 7:43 PM, gmkdroid <gmkdroid_at_[hidden]> 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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk