Ch. 16 Exceptions, Templates, and the Standard Template Library Flashcards

1
Q

The line containing a throw statement is known as the ________.

A

Throw Point

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The ________ block contains code that directly or indirectly might cause an exception to be thrown.

A

Try

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The ______ block handles an exception.

A

Catch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When writing function or class templates, you use a(n) ________ to specify the generic data type.

A

Type Parameter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The beginning of a template is marked by a(n) ______.

A

Template Prefix

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When defining objects of class templates, the ________ you wish to pass into the type parameter must be specified.

A

Data Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A(n) ______ template works with a specific data type.

A

Specialized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A(n) ________ container organizes data in a sequential fashion similar to an array.

A

Sequence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A(n) _______ container uses keys to rapidly access elements.

A

associative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

_______ are pointer like objects used to access data stored in a container.

A

Iterators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The ________ exception is thrown when the new operator fails to allocate the requested amount of memory.

A

bad_alloc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

There can only be one catch block in a program. t/f

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When an exception is thrown, but not caught, the program ignores the error. t/f

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Data may be passed with an exception by storing it in members of an exception class. t/f

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Once an exception has been thrown, it is not possible for the program to jump back to the throw point.

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

All type parameters defined in a function template must appear at least once in the function parameter list. t/f

A

true

17
Q

The compiler creates an instance of a function template in memory as soon as it encounters the template. t/f

A

false

18
Q

A class object passed to a function template must overload any operators used on the class object by the template. t/f

A

true

19
Q

Only one generic type may be used with a template. t/f

A

false

20
Q

In the function template definition, it is not necessary to use each type parameter declared in the template prefix. t/f

A

false

21
Q

It is possible to overload two function templates. t/f

A

true

22
Q

It is possible to overload a function template and an ordinary (nontemplate) function. t/f

A

true

23
Q

A class template may not be derived from another class template. t/f

A

false

24
Q

A class template may not be used as a base class. t/f

A

false

25
Q

Specialized templates work with a specific data type. t/f

A

true

26
Q

When defining an iterator from the STL, the compiler automatically creates the right kind, depending upon the container it is to be used with. t/f

A

true

27
Q

STL algorithms are implemented as function templates. t/f

A

true