[typeof] BOOST_TYPEOF_NESTED_TYPEDEF semicolon

AMDG The definition of BOOST_TYPEOF_NESTED_TYPEDEF includes a semicolon at the end. It should act like a normal statement. In Christ, Steven Watanabe

"Steven Watanabe" <steven@providere-consulting.com> wrote
The definition of BOOST_TYPEOF_NESTED_TYPEDEF includes a semicolon at the end. It should act like a normal statement.
There was a discussion in the past about whether or not such macros should contain semicolons. There was no agreement on this. We decided to include semicolons in typeof macros, where possible. This way it can be used with or without semicolon at the end. Of course this is not related to BOOST_TYPEOF or BOOST_AUTO, but BOOST_TYPEOF_REGISTER_XXX macros, for example, all contain semicolons at the end. Regards, Arkadiy

Arkadiy Vertleyb <vertleyb <at> hotmail.com> writes:
"Steven Watanabe" <steven <at> providere-consulting.com> wrote
The definition of BOOST_TYPEOF_NESTED_TYPEDEF includes a semicolon at the end. It should act like a normal statement.
There was a discussion in the past about whether or not such macros should contain semicolons. There was no agreement on this. We decided to include semicolons in typeof macros, where possible. This way it can be used with or without semicolon at the end.
Of course this is not related to BOOST_TYPEOF or BOOST_AUTO, but BOOST_TYPEOF_REGISTER_XXX macros, for example, all contain semicolons at the end.
Regards, Arkadiy
As far as I can make out from the standard, an extra semicolon is only permitted at function scope. Trying to put a semicolon after BOOST_TYPEOF_NESTED_TYPEDEF inside a class or at namespace scope causes warnings on at least metrowerks 9.2 and como 4.3.3 In Christ, Steven Watanabe

"Steven Watanabe" <steven@providere-consulting.com> wrote
Arkadiy Vertleyb <vertleyb <at> hotmail.com> writes:
"Steven Watanabe" <steven <at> providere-consulting.com> wrote
The definition of BOOST_TYPEOF_NESTED_TYPEDEF includes a semicolon at the end. It should act like a normal statement.
There was a discussion in the past about whether or not such macros should contain semicolons. There was no agreement on this. We decided to include semicolons in typeof macros, where possible. This way it can be used with or without semicolon at the end.
Of course this is not related to BOOST_TYPEOF or BOOST_AUTO, but BOOST_TYPEOF_REGISTER_XXX macros, for example, all contain semicolons at the end.
As far as I can make out from the standard, an extra semicolon is only permitted at function scope. Trying to put a semicolon after BOOST_TYPEOF_NESTED_TYPEDEF inside a class or at namespace scope causes warnings on at least metrowerks 9.2 and como 4.3.3
I think you are right -- double semicolon cannot be used in all contexts, and this makes not using semicolon the only correct usage. As far as I can remember, when this was discussed (I am no longer able to find the thread), Paul Mensonides was in strong disagreement with the idea of a macro usage looking "like a normal statement". Frankly speaking I have no strong opinion on the subject. I do believe, however, that this should be the subject of standartization inside Boost, so that the users don't become confused while working with multiple libraries. If such a guideline is accepted, we will change the typeof macros to comply. Regards, Arkadiy
participants (2)
-
Arkadiy Vertleyb
-
Steven Watanabe