According to g++ and comeau, the following is illegal: (The commented line
allows the code to compile.)

class A {
   public:
      A () {}
      ~A () {}

   private:
      class Nested;
   //friend class B;
};

class B {
   public:
      B () {}
      ~B () {}

   private:
      friend class A::Nested;
};

Here's why:
"7 A name nominated by a friend declaration shall be accessible in the scope
of the class containing the friend declaration."

It is ridiculous that I can't give access to an inaccessible class. You have
to have access to be able to give it? What is the justification for this?




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to