Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] implementing an computer algebra systemwith proto
From: Eric Niebler (eric_at_[hidden])
Date: 2009-01-28 18:18:19


Dave Jenkins wrote:
> "Kim Kuen Tang" wrote:
>> Perhaps we can first check whether var1_ appears in the expression. If
>> not we can return the expression unmodified.
>
> The way to check if the expression is valid for a grammar is something
> like the code below.
> I'm hoping Eric can automatically do this check when a compile-time
> debug flag is defined.

The way I'll do this is add an MPL assert that the expression matches
the grammar before invoking its transform. I can do this in
proto::transform::operator(), and I can compile it conditionally only if
BOOST_COMPILE_TIME_DEBUG is defined.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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