|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2005-07-14 15:22:27
"Arkadiy Vertleyb" <vertleyb_at_[hidden]> writes:
> We have a similar problem in typeof, and at this point semicolon is not
> required. This leads to all the problems with the editor that you
> mentioned, and, if the user does supply the (second) semicolon, some
> compilers emit warnings, so I am by no means happy with the situation.
>
> However, if the semicolon is required, and the user doesn't supply it, the
> compiler will produce an error message, which will expose implementation
> details of this macro, and most likely be of little help.
Actually, that seems much better to me than the alternative: if the
macro supplies the semicolon, and the user mistakenly supplies an
extra semicolon, many compilers *don't* warn/error, which means that
the user doesn't find out her code is nonportable until it breaks on
some other compiler or set of compiler options.
> So, the choice is actually between two evels, and I am not really
> sure which one is less evel.
>
> Also, I think, this problem is very generic, and once it's decided which
> style is prefferrable, it may be a good idea to turn it into a guideline, so
> that it is consistent between the Boost libraries.
Yeah. My only hesitation is that Paul Mensonides as been a vocal
opponent of requiring the semicolon in many contexts.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk