Class Template: Friends
Explore the concept of friends in class templates within Modern C++. Understand how friendships are granted to classes, functions, and types, the rules governing these relationships, and their impact on member access. This lesson clarifies how special and general friendships work in class templates.
We'll cover the following...
We'll cover the following...
Friends of a class template have access to all members of the class template
A class or a class template can have a friendship three features: to class or class templates, to function or function templates, and to types.
Rules:
- The declaration of friends can be made in an arbitrary place in the class