Boost logo

Boost :

From: Eric Woodruff (Eric.Woodruff_at_[hidden])
Date: 2002-11-23 10:57:17


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?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk