Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2005-07-18 14:29:48


"Dave Steffen" <dgsteffen_at_[hidden]> wrote
> Arkadiy Vertleyb writes:
> > Hi all,
> >
> > Not having extra semicolons is one of the strongest arguments
> > against incuding a trailing semicolon into a statement-generating
> > macro. Can anybody explain why having an extra semicolon is
> > considered a potential problem by some compilers? Isn't null as
> > good as any other number? Shouldn't an empty statement be
> > considered as good as any other statement?
>
> Ths issue is IIRC and AFAIK macros that are used outside of any
> statement blocks, i.e. the thing David Abrahams suggested that
> spawned this whole thread. Something like a macro that declares or
> defines a function:
>
> #define MAKEFOO inline void foo () { ... }
>
> and then simply used as:
>
> (... other inline functions, for example ...)
> MAKEFOO;

FWIW This compiles fine in VC7.1 .
AFAIK there is no C++ rule banning an empty statement in any scope( including
namespace scope) where a statement is otherwise allowed.

Andy Little


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