Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-08-09 15:43:42


Sascha Friedmann wrote:
> I understand now the problem, but in my real project I ran again into
> this trap. After rereading the article in the rationale I understand
> fully why it is trapping, but I don't want to set my class to
> track_never because I can't guarantee that it is what I want.

Hmm - you want to make unmaintainable code? If this is what
you want - just comment out the trap in your own copy
of iserializer.hpp and you'll be done.

> const_cast is no solution, too.

Why not? It's explictly designed to permit override of "const"
where the user is more knowledgable than the library
writer regarding what he want's to do. That's the situation here.
It might also serve as a "red flag" for the programmer which
has to fix your program in the future when it breaks.

> So the thing that is left is this construct_from class-wrapper.
> But it seems it is only an example an not a part of the
> boost::serialization library.

I have no idea what construct_from class-wrapper refers to.

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