My new favorite programming language feature

Friendship in C++: A friend of a class is an external function or class that has access to the private and protected members of this class. Isn’t it lovely?

More favorites:

tags:

2 Responses to “My new favorite programming language feature”

  1. bene Says:

    As an undergrad, one of my CS professors explained friend classes this way:
    Friends can play with your private parts.
    :D

  2. jesus gollonet Says:

    yes, that’s a lovely feature for a friend to have

Leave a Reply