Subject: Re: [boost] [serialization] problems implementing free-standing functions
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-03-03 15:01:01
From: Thorsten Ottosen [mailto:thorsten.ottosen_at_[hidden]]
> From: Thorsten Ottosen [mailto:thorsten.ottosen_at_[hidden]]
> Sent: Monday, March 02, 2009 10:35 AM
> To: boost_at_[hidden]
> Cc: Robert Ramey
> Subject: Re: [serialization] problems implementing free-standing functions
> Hi Robert,
> FWIW, I still stumple into the problem that you can't serialize a non-const
> object. This happens even for something as simple as serializing an int.
> I thought you had replaced this behavior with a sort of warning instead?
I believe that I did changed it from BOOST_STATIC_ERROR TO
BOOST_STATIC_WARNING in the latest released version. Note that the
implemenation BOOST_STATIC_WARNING is non-portable and for at least one
platform I couldn't implement it so I left it as a no-op.
> If I would be to use the library for teaching or otherwise, I would just be
> littering my code with
> << ... ( as_const(x) )
> and if I do so, I probably don't get any help to track down the problems you
> claim this prevents.
Well, you can't have it both ways. Either the library flags the situation
with (now) warning or it doesn't. I realize that my view on the
not universally held, but I'm more firmly convinced than ever that the
pepper one's code with const_cast is an indication of problems in the
and/or implemenation of the code.
> Is it not posssible to turn this feature into a debugging aid, rather than
> something that is enabled by default? I'm thinking that the cost of the
> current strategy very much out-weights its benefits :-( .
*** that was my intention when I changed it from ERROR to WARNING.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk