Ugh, you're right :( I had originally tested in a class-less function. Within 
class declarations "using" is only good for things in the base class.

http://en.cppreference.com/w/cpp/language/using_declaration

----- Original Message -----
> On Fri, Nov 1, 2013 at 9:03 AM, Monica Chew <m...@mozilla.com> wrote:
> 
> > This compiles using g++ for me.
> >
> > namespace foo {
> > namespace bar {
> > class baz;
> > }
> > }
> >
> > using foo::bar::baz;
> > class nsSVGUtils
> > {
> > public:
> >   static baz GetFillRule(baz* aElement);
> > };
> >
> > int main(void) {
> >   return 0;
> > }
> >
> 
> If we put that in nsSVGUtils.h, then that "using" directive brings "baz"
> into the global scope for every translation unit that needs to #include
> nsSVGUtils.h, which is no good. Putting a typedef in the class makes "baz"
> available only within nsSVGUtils, which is what we want.
> 
> C++ just sucks here :-(.
> 
> Rob
> --
> Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
> le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
> stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
> 'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
> waanndt  wyeonut  thoo mken.o w  *
> *
> 
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to