This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.
>I'm surprised the scope resolution operator :: does not allow
>whitespace on either side, since it is grammatically an operator, not
>part of an identifier. This might be a bug in the C++ front end. Or
>I might be demonstrating once again that I know squat about C++.
It looks as if the frontend uses whitespace to disambiguate
namespace Foo { int bar2; }
struct Foo { ... }
void func (void) {
Foo ::bar1;
Foo::bar2 = 3;
}
The best workaround I can come up with is
#ifdef HAVE_NAMESPACES
#define SCOPED(space, symbol) space##::##symbol
#else
#define SCOPED(space, symbol) ::##symbol
#endif
Bletcherous, but I guess it'll have to do =(
Any idea how soon namespaces will be widely supported?
____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1