
From: Thorsten Ottosen [mailto:thorsten.ottosen@dezide.com]
From: Thorsten Ottosen [mailto:thorsten.ottosen@dezide.com] Sent: Monday, March 02, 2009 10:35 AM To: boost@lists.boost.org 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 subject is not universally held, but I'm more firmly convinced than ever that the need to pepper one's code with const_cast is an indication of problems in the design 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.