Describe the friendship relationships established by placing each of the following friend declara- tions inside this class template. Identifiers beginning with “f ” are functions, identifiers beginning with “C” are classes, identifiers beginning with “Ct” are class templates and T is a template type parameter (i.e., T can represent any fundamental or class type).

Suppose that a class template has the header
```
template< typename T > class Ct1
```
a) ```
friend void f1();
```
b) ```
friend void f2( Ct1< T > & );
```
c) ```
friend void C2::f3();
```
d) ```
friend void Ct3< T >::f4( Ct1< T > & );
```
e) ```
friend class C4;
```
f) ```
friend class Ct5< T >;
```


a) Function f1 is a friend of every class template specialization instantiated from class template Ct1.
b) Function f2 receives a parameter that is a reference to a specialization of class template Ct1. The function is a friend of only that specialization. For example, if the parameter type is Ct1< int > &, then function f2 is a friend of the specialization
Ct1< int >.
c) Member function f3 of class C2 is a friend of every class template specialization instantiated from class template Ct1.
d) Member function f4 of a given specialization of class template Ct3 receives a parameter that is a reference to a specialization of class template Ct1 with the same template argument. The function is a friend of only that specialization. For example, if the parameter type is Ct1< int > &, then function f4 is a friend of the specialization Ct1< int >.
e) Every member function of class C4 is a friend of every class template specialization instantiated from the class template Ct1.
f) For a given class template specialization Ct5< T >, every member function is a friend of the specialization of class template Ct1 with the same template argument. For example, if T is int, every member function of class template specialization Ct5< int > is a friend of the class template specialization Ct1< int >.

Computer Science & Information Technology

You might also like to view...

A DDBMS may be classified as homogeneous or heterogeneous. Compare and contrast these two types of distributed systems.

What will be an ideal response?

Computer Science & Information Technology

What is the job of the compiler? What does the linker do? Describe the differences between a compile error and a link error.

What will be an ideal response?

Computer Science & Information Technology

Text can be created in a fixed-width text block or in a single-line text block that extends as you type.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Code selector names are preceded by a period in the code and in the CSS panel.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology