Boost logo

Boost :

From: James Dennett (jdennett_at_[hidden])
Date: 2002-04-08 13:55:44

David Abrahams wrote:

>I think I've hit on the (nearly) perfect compromise for my use of the
>preprocessor lib. I want to write out the first few repeats of a family
>of repeated constructs by hand (for debugga- and comprehensi- bility),
>then generate additional repetitions as specified by a numeric macro
>argument. The problem I've got is one of maintenance. How can I verify
>(preferably using the compiler or other automated tools) that my PP
>construct generates the same code as the other one?
>I guess one possibility would be to temporarily turn off the
>hand-written instances and try to compile again, but that's not really
>the same as verifying that they generate the same tokens, is it?
>Any hints appreciated,
This might be a place where some code I've written for my
own amusement might come in handy: I've nearly finished
writing a C++ preprocessor, in C++, and once I finish the
last few pieces (which admittedly might take a month of
chunks of my "spare" time) it might well be easy to use it
to check that the generated token sequences are the same.
I don't claim that it'll be a *fast* preprocessor, but I do intend
to make sure that it is as clean and reliable as possible.

Let me know if you're interested.

-- James.

Boost list run by bdawes at, gregod at, cpdaniel at, john at