Boost logo

Boost Users :

From: Dan Bikel (dbikel_at_[hidden])
Date: 2006-08-24 17:17:24


Robert Ramey wrote:
> > Error No. 1 can be fixed by making pFoo a const pointer type, i.e., by
> > changing the declaration/assignment statement to be
> > string *const pFoo = new string("foo");
> >
> > I cannot figure out why such a change is necessary, as the
> > serialization library documentation does not indicate that it is
> > necessary to make pointers const in order to serialize them (as is
> > borne out by the demo.cpp code).

> This is explained in the "Rationale" section of the documentation.

Okay, I read through the (long) scenario described in the Rationale
section, and I guess I agree with this design decision, but in the
main documentation--the Tutorial section in particular--there should
not be code snippets that are incorrect. I'm thinking of the example
in the "Pointers" section of the tutorial, where the sample code shows
*non-const* bus_stop pointers being serialized in order to serialize
"bus_route" objects. At the very least, you should have correct code
and a hyperlink to the Rationale section explaining why the const is
there.

Anyway, I don't mean this to sound harsh, because I'm very grateful
for your prompt answer to my question!

--Dan.


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