This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/29615] Class can't be friends of itself?



------- Comment #3 from jens-devel at gmx dot de  2007-10-15 12:48 -------
Subject:  Class can't be friends of itself?

Hi,

I think gcc should be able to compile something like this.
There is no other way to make a member-variable accessible only from all
objects which are of the same type. Am I wrong?

<test.cpp>
class A
{
  friend class A;

  private:
        int var_accessible_from_all_A_objects;
};

int main() { return 0; }
</test.cpp>

Greetings
Jens


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29615


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]