15 Sep
2009
15 Sep
'09
6:02 p.m.
Hello, How to grant load_construct_data() the permission to access private members of the serializable class? friend class ::boost::serialization::access; // doesn't help template<class Archive> friend void ::boost::serialization::load_construct_data(Archive &ar, MyObj *t, const unsigned int file_version); // doesn't compile with MSVC9.0SP1 One of my classes can be created with a static function only: class Foo { public: shared_ptr<Foo> create(Arg a) { shared_ptr<Foo> self(new Foo(a)); self->init(); return self; } private: Foo(Arg a); void init(); }; I try to simulate this behavior in load_construct_data() function. Thanks.