Quiz 3 Flashcards

1
Q

Templates

A
  • Single definition
  • Permits reuse
  • Compiler makes specific versions when functions are used
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Function Templates

A

a specific behavior that can be applied to any data type

*use when applying the same function to multiple data types

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

Function Template Declaration

A
template 
void function(T param){}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Calling Template Declaration

A
  • compiler substittues param types
  • then compiles version of function
  • multiple copies can be created
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Template Functions vs Function Templates

A

Template functions: individually compiled functions

Function templates: entire range of related functions with same code

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

Class Templates

A

*h: template
class ClassName {}
*.cpp:template
ClassName::ClassName()

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

Template Classes vs Class Templates

A

Class templates are entire range

Template classes are individual instantiated versions

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

Specialization

A
  • template provided with a set of template arguments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Class Templates and Compiling

A
  • does not compile unused methods (could be wrong)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Overloading

A

multiple functions have the asme name occur in the same scope, but have DIFFERENT signatures

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

Overriding

A

(inheritance) derived class function has the same name and signature as a base class virtual function

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