Boost logo

Boost Users :

From: Hector C. (hhcalderon_at_[hidden])
Date: 2007-08-17 19:27:58


THANK YOU! (Shouting intended)

Just for future reference, your solution lead me to:

    A a;
    {
        ofstream off("test.txt");
        boost::archive::text_oarchive oa(off);
        oa << (const A &)a;
    }

--Hector C.

--- Frank Birbacher <bloodymir.crap_at_[hidden]> wrote:

> Hi!
>
> Hector C. schrieb:
> > ----MESSAGE----
> > // if your program traps here, it indicates
> taht
> > your doing one of the following:
> > // a) serializing an object of a type marked
> > "track_never" through a pointer.
> > // b) saving an non-const object of a type not
> > markd "track_never)
> > // Either of these conditions may be an
> indicator
> > of an error usage of the
> > // serialization library and should be double
> > checked. See documentation on
> > // object tracking.
> > --END MESSAGE--
>
> Read up here:
>
http://www.boost.org/libs/serialization/doc/index.html
>
> > int main(int argc, char * argv[])
> > {
> > A a;
>
> change to: const A a;
>
> > {
> > ofstream off("test.txt");
> > boost::archive::text_oarchive oa(off);
> > //Uncommenting any of the following lines
> > //produces compilation errors
> > //oa << a;
>
> use oa << a;
>
> > //oa << (const A) a;
>
> do not use the cast "(const A)". It's bad.
>
> > }
> > return 0;
> > }
> > ---END CODE---
>
> Frank
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
>
http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

----------------------------------

       
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's
Comedy with an Edge to see what's on, when.
http://tv.yahoo.com/collections/222


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