Re: declaring a protected member function as friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> This might answer to your question :
> "A name nominated by a friend declaration shall be
> accessible in the scope of the class containing the
> friend declaration." (ISO C++ standard 11.4.7)

To clarify, does this then mean that one can never allow a protected method
from class A to have friend access to class B? While this may be in the
standard, it doesn't make sense to me as the friend declaration is not
*calling* the protected method, but allowing the protected method friend
access to itself, which is completely different.

Also, does this then carry over to friend classes? As in ...

class A
{
public:
  void pubFunc();
protected:
  void protFunc();
};

class B
{
protected:
  friend class A;
};

Does this then mean that A::protFunc() doesn't have protected access to B?


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux