Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] implementing an computer algebra systemwith proto
From: Joel de Guzman (joel_at_[hidden])
Date: 2009-01-28 20:58:57


Dave Jenkins wrote:
> "Eric Niebler" <eric_at_[hidden]> wrote in message
> news:49808FDC.5040006_at_boost-consulting.com...
> >
>> That is not a half-bad suggestion. It's funny that we have NDEBUG to
>> avoid costly runtime checks but no equivalent for costly compile-time
>> checks.
>>
>> I've never particularly cared for the "N" in "NDEBUG" ... it seems the
>> wrong default. Perhaps we can have a boost-wide macro for expensive
>> compile-time checks. How about BOOST_COMPILE_TIME_DEBUG?
>
> I think a BOOST_COMPILE_TIME_DEBUG flag is a good idea.
>
> I was surprised that transforming an invalid expression produced exactly
> the same output as transforming a valid expression.
> It was undetectable that you were depending on compile time UB.
>
> To be sure that you aren't getting compile time UB, you have to test
> each expression against each transform grammar for a match.
> I doubt people will think to do that without help.

I have the same idea a while back. I'll suggest not making it a flag
but an integer that gives the level of debugging. That way, you
have 0 == no CT debug, 1..3 CT debug levels.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

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