Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-04-02 19:17:56


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?

How about a variation of the scheme used by MPL - write out the first few
repeats by hand (two, usually), test them, turn them into preprocessor
library-based generator, use the compiler to generate the desired number of
repeats from it, pretty-format the output (not by hand :), place it in a
separate header, and include it conditionally into original generator
header. If found a bug, fix it in the generator sources, re-generate the
pretty output, and debug it; repeat if needed :). The most troublesome part
here is to find good enough tool for pretty-formatting.

Aleksey


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