-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Dave Steffen
How about adding a superfluous struct at the end of the function?
#define f(T) void my_func(T i) { do_sthg(); } struct semicolon_eater {}
I haven't tried this yet, but it's the sort of thing I was fishing for. If the language says semicolons are illegal in certain places, but I want semicolons there (maybe for good reasons, maybe "just because, dammit!"), is there a clever construct that will let me get away with it?
I'm gonna go try this (or something like it) soon, will report back. The advisability of doing this sort of thing is, perhaps, debatable; one of the reasons I wanted to push to GCC 3.4 is precisely this sort of thing: what are we doing that we shouldn't be?
As I'm sure you're aware of my opinion on this, so I won't repeat it. If you going to do it anyway, then add a namespace somewhere... namespace empty { }; ...and then make the macro expansion end with: using namespace ::empty As in, #define f() \ void my_func() { do_something(); } \ using namespace ::empty \ /**/ f(); This shouldn't introduce any names into whatever scope you're in. Regards, Paul Mensonides