Why does C# not provide the C++ style ‘friend’ keyword? [closed]

On a side note.
Using friend is not about violating the encapsulation, but on the contrary it’s about enforcing it. Like accessors+mutators, operators overloading, public inheritance, downcasting, etc., it’s often misused, but it does not mean the keyword has no, or worse, a bad purpose.

See Konrad Rudolph‘s message in the other thread, or if you prefer see the relevant entry in the C++ FAQ.

Leave a Comment