Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2003-08-01 22:53:12


"Fernando Cacciola" <fcacciola_at_[hidden]> writes:

> [snipped]

>> So, I like Dave's macro, though I would prefer code generation macros
>> not to be put in code directly requiring users to know the inner
>> details of expanded code (for debugging, for instance).
>>
>> Just a thought.
>
>FWIW, my macro only generates declarations, so it doesn't interfere
>with debugging.
>
>--
>Dave Abrahams
>
Yep, I've noticed.
I actually voiced that opinion even though your macro _in particular_ seemed OK just to set the records for the kind of trouble
that can ocurr if code repetition tasks are replaced by macros without properly balancing the drawbacks and implied subtelties.

For instance, many of the complains I've received were because invalid macro arguments led to impossible to understand error
messages. Even if the macro just adds a declaration, figuring out the source of the error can be impossible without knowing the
expanded text of the macro. We even tried to code-up some sort of utility to expand macros on-the-fly with the given arguments,
but that was impractical for us because the complete macro expansion could depend on many other macros and so on, so the
"utility" must have access to the entire source and include tree.

Fernando Cacciola


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