Boost logo

Boost :

From: Michael Behrns-Miller (m_at_[hidden])
Date: 2005-07-01 16:51:09


> David Abrahams wrote:
>> "Michael Behrns-Miller" <m_at_[hidden]> writes:
>>
>>> 2) The new "const required to save" restriction bit me, took a day or
>>> two to work through the mailing list and #boost to figure out the
>>> problem. Is
>>
>> Did it prevent a bug, or did it just cost you 2 days of your valuable
>> time?
>
> Were you not tempted to just use "const_cast"? Why not?

I temporarily tried it and got it to work, but that wasn't an acceptable
solution to me. I hate casting, immediately makes me reassess the design.
 Which I did, which led me to the answer. :P

I expected to have ramp-up time with boost. I probably spent a day
fiddling with bjam, a half day figuring out to include boost libraries,
and a day or two on the const issue. Not full days, just poking around in
my spare time. I got everything working under vc71 and gcc 3.3.5 way
before getting frustrated, so I was happy.

Also, to be fair to you, I was using a verbatim copy of the demo code to
start, which I believe needs updating. I was working from documentation
that didn't cover the const issue. With those two improvements, I would
have been better off.

But I am not foolish enough to pretend I have the answer to the const
issue, especially given there are many current serialization users. Just
providing some feedback. <ducks and runs>

> Whenever I do include a BOOST_STATIC_ASSERT that a library user might be
> expected to trip on, I include comments at that point which describes the
> problem and hopefully a helpful course of action. When I build in my
> environment (VC 7.1) and double click on the error message, the
> BOOST_STATIC_ASSERT pops up and right there is the comment explaining it.
> To me, this seems pretty good and I would hope that this would minimize
> the time a user has to spend looking for sources to these problems. In
> fact, I have received mail from users that have remarked upon exactly
> this feature/practice as being very helpful in understanding these other
> wise very subtle errors. By far the best one is when one uses an
> xml_archive to serialize something which doesn't have a variable name
> attached. It pops a STATIC_ASSERT and the comment right there is the
> comment describing what one is doing wrong.

I agree, that's where I started when figuring it out, looking at the error
line, which clued me in.

Thanks again.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk