|
Boost Users : |
Subject: Re: [Boost-users] Boost; Default constructor work around.
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2009-02-26 07:17:03
niranjan bangera wrote:
> Hi,
> I need to know the information abt Constructor in my class to be
> serialized. What if i dont have defualt constructor in my class.
> Any other work around rather then putting the default construcor in my
> class, Pls Let me know if any workaround or doccumentaion.
>
> Boost: 1.38.0
> ====
>
> Compiler:
> ======
> /_TOOLS_/dist/gnu-gcc-/4.1.1-binutils-2.16.1/x86_64-pc-linux2.4/bin/gcc
>
> class Myclass
> {
> Myclass (const string & a)
> {
> name=a;
> }
> private:
>
> int a;
> string name;
> //serialization code
> };
See the section on references, there's an example:
http://www.boost.org/doc/libs/1_38_0/libs/serialization/doc/serialization.html#references
Jeff
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