Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2007-04-25 11:17:15


John Pye wrote:
> Hi all,
>
> I have some trouble with the Boost.Serialization library. I have
> compiled the 'demo.cpp' example, and now I am trying to distill it a
> little, so that I can understand how to apply it to my own polymorphic
> class hierarchy. However I keep seeing the same error message, and
> can't work out what it means.
>
> In /usr/include/boost/archive/detail/oserializer.hpp:567 there are
> some comments about the error message I'm seeing but I don't
> understand what those comments mean. I'm using Boost 1.33.1-7ubuntu1
> on Ubuntu 6.10.

Try the following change:

> int main(int argc, char *argv[]){
>
> const dd D(10,20); // note: const
> const int x = 5; // note const
>
> std::cerr << D << std::endl;
>
> std::ofstream ofs("test.txt");
> boost::archive::text_oarchive oa(ofs);
> oa << x;
> oa << D;
>
> return 0;
> }

Read the "rationale" section of the documentation for a complete expanation.

Robert Ramey


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