Top "Friend" questions

In object-oriented programming, friend refers to a method or class that has access to some non-public aspects of a particular class.

When should you use 'friend' in C++?

I have been reading through the C++ FAQ and was curious about the friend declaration. I personally have never used …

c++ oop encapsulation friend
Error with multiple definitions of function

I am trying to relearn C++ after taking an intro course a few years ago and I’m having some …

c++ definition friend
Is there a way to simulate the C++ 'friend' concept in Java?

I would like to be able to write a Java class in one package which can access non-public methods of …

java c++ friend accessor
Why does C# not provide the C++ style 'friend' keyword?

The C++ friend keyword allows a class A to designate class B as its friend. This allows Class B to …

c# c++ design-patterns oop friend
Why does C++ not allow inherited friendship?

Why is friendship not at least optionally inheritable in C++? I understand transitivity and reflexivity being forbidden for obvious reasons (…

c++ inheritance language-design friend
'Friends' equivalent for Java?

having a little architectural trouble here. In C++, we have the notion of 'friends,' where such friend classes can …

java design-patterns friend
c++ friend function - operator overloading istream >>

My question is in regards to friend functions as well as overloading the << and >>. From my …

c++ operator-overloading friend operator-keyword
What is the equivalent of a 'friend' keyword in C Sharp?

What is the equivalent of a 'friend' keyword in C Sharp? How do I use the 'internal' keyword? I have …

c# friend internal friend-class
overloading friend operator<< for template class

I have read couple of the questions regarding my problem on StackOverflow.com now, and none of it seems to …

c++ templates operator-overloading friend ostream