Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2005-07-19 16:05:56


> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Jason McCarty

> Paul Mensonides wrote:
> > Incidentally, this should automatically be:
> >
> > if (something) {
> > MACRO_INVOCATION(); // semicolon argument aside } else
> > ...
> >
> > Because if the macro expands to statement, it could just as easily
> > expand to a series of statements.
>
> But doesn't everybody wrap those in do-while loops? I.e.,
> #define FOO do { bar; baz; } while (false)

I don't. I think that it increases the complexity of the macro for the only
purpose of making the macro use look like its a regular syntactic element--which
I don't think is a good idea, and therefore don't do it.

Regards,
Paul Mensonides


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