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

1. Templates allow only parameterized types for class templates
2. Templates allow only parameterized types for functions.
3. In writing a class template, the function declarations within the class require special placement.
4. 17. In implementing class template member functions, the functions are themselves templates.
5. In the implementation of a class template function, the class name before the scope resolution operator is just the class name, with no additional syntax.


1. False.
The template facility provides for both parameterized types in functions and in classes.
2. False.
The template facility provides for both parameterized types in function templates and in class templates.
3. False:
The member functions for a class template are defined the same way and put in the same location as member functions for ordinary classes. The only difference is that the member functions are themselves templates.
4. True
The functions require definition with template prefix as do any other function template.
5. False.
If the template class name is Pair, the class name before the scope resolution operator must be Pair, not just Pair. If only Pair is used, without the , there will be no function instance generated, causing hard to understand error messages.

Computer Science & Information Technology

You might also like to view...

A method that does not alter a linked list, but simply looks at it to determine whether it’s empty, is referred to as a(n) _____________ method.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The nodes (leaves) of the DNS database tree structure are called ____________________ and have labels.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Match the following terms to their meanings:

I. Web site for exchanging files A. pop-ups II. Customized advertisements that appear on Web sites B. peer-to-peer file sharing III. Anything that you use or download from a Web site C. cookie IV. Stores information about you and your preferences D. Web content V. Protocol that encrypts the data sent between you E. https and a Web server

Computer Science & Information Technology

While a function is executing, only variables and parameters that are in the ____________________ for that function can be accessed.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology