Chapter 33 Flashcards
1
Q
Is it possible that we make a generic template specialize to specifically handle a particular type
A
Yes
2
Q
How compiler diagnose types error
A
Compiler do that with static type checking
3
Q
What is the difference between overloading and templates
A
Overloading deals with different data types with similar operation. And template deals with different data types with identical operation
4
Q
What is template policy
A
The central idiom in policy-based design is a class template (called the host class), taking several type parameters as input, which are instantiated with types selected by the user (called policy classes), each implementing a particular implicit interface (called a policy)