Topic: Question about a local class' access rights


Author: Michael Greenberg <mlg@scr.siemens.com>
Date: 1996/07/18
Raw View
Do local classes have the same access rights that its enclosing
function has?

For example:

class foo {
 private:
  struct bar { int i; } ;
  void yyy() ;
  friend void xxx() ;
} ;

void xxx()
{
  struct r {
    foo::bar b; // is this legal
    int x() { return b.i; } // is this legal
  } ;
}

void foo::yyy()
{
  struct r {
    foo::bar b; // is this legal
    int x() { return b.i; } // is this legal
  } ;
}




Thanks,

--
Michael Greenberg                      email: mgreenberg@scr.siemens.com
Siemens Corporate Research             phone: 609-734-3347
755 College Road East                  fax: 609-734-6565
Princeton, NJ 08540
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]