a quick about namespaces

Alexandre Oliva aoliva@redhat.com
Tue Jan 22 18:26:00 GMT 2002


On Jan 23, 2002, Nic Ferrier <nferrier@tapsellferrier.co.uk> wrote:

>    throw new java::lang::IllegalStateException ( ... );

> but the code generated by current gcjh does this:

>    throw new ::java::lang::IllegalStateException ( ... );


> Is this significant? Is there something here that I have to
> understand?

What if your package had a sub-package named java?  The initial `::'
tells g++ to start from the global namespace, so that it will never
start from the current namespace.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Java mailing list