Re: Befriending a private member function

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

 



"Herwig, Björn" <herwig@xxxxxxxx> writes:

> I recently came across a rather historic piece of C++ code once written for G++ 3 point
> something. It doesn't compile with a G++ 4, as it tries to befriend a private member
> function. Okay, this is easily solved by befriending the whole class, but I am really
> curious now, why this isn't allowed anymore.
>
> I've read the corresponding sections in "The C++ Programming Language, Special Edition"
> and section 11.4 of the C++ 2003 standard, but that still left me clueless.
>
> Could anybody give me a hint?


ISO C++98 [friend.class] paragraph 7:

    A name nominated by a friend declaration shall be accessible in the
    scope of the class containing the friend declaration.

Ian


[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