Topic: Nested class friends and access


Author: "Michael Rice" <mpr@absoft.com>
Date: 1996/08/29
Raw View
Is the following legal according to the May 96 (or any) draft?  I cannot
seem to find the appropriate section:

class X {
    class H;  // private member class to be defined later

    class Y {
        friend class X::H;  // ok? or error since X::H is not accessible here?
 class X::H* y;     // illegal? X::H not accessible...
    };
};

class X::H { // legal according to [class.nest] 9.7 even though
 //...  // X::H is not accessible at file scope
};

X::H v;  // illegal since X::H is not accessible at file level?


Thanks.

--
Mike Rice (mpr@absoft.com)
Absoft Corporation
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]