This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25427] Impossible to create a friend function for a class in a namespace, outside the namespace.
- From: "sela_lerer at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Dec 2005 18:00:13 -0000
- Subject: [Bug c++/25427] Impossible to create a friend function for a class in a namespace, outside the namespace.
- References: <bug-25427-11884@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from sela_lerer at hotmail dot com 2005-12-16 18:00 -------
(In reply to comment #6)
> (In reply to comment #5)
> > Ok, but what about an inner class? If A had a public inner class B and the
> > outer function had to operate on it?
>
>
> The code is still invalid. Just there is no simple work around except split
> the class up like:
> namespace S
> {
> class A {
> class B;
> methods ....
> };
> }
>
> function prototype to friend with;
>
> class S::A::B
> {
> friend function;
> methods;
> };
>
> function;
>
hmmm.. ugly.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25427