What is Template Specialization?



What is Template Specialization?..

Answer / bob

there are partial and full specializations for template
class, and only full partial specialization for template
function.

template <class T, size_t size>
class Object {};

full specialization:
template <> class Object<int, 10> {};

partial specialization:
template <size_t size> class Object<char, size> {};

Function specialization:
template <typename T>
void reserve(T begin, T end)

Specialization:
void reserver(char *begin, char *end) //actually overload
function

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More STL Interview Questions

What is Object Oriental Progam

2 Answers  


To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command

0 Answers  


What does stl stand for in basketball?

0 Answers  


What is a list in c++ stl?

0 Answers  


What are the various types of stl containers?

0 Answers  






Which data structure gives efficient search? A. B-tree B. binary tree C. array D. linked list

21 Answers   ABC, Sun Microsystems,


what's the difference between abstract class and concreate class? what's the meaning of standard template library(STL)?

2 Answers  


write a program to demonstrate,how constructor and deconstructor work under multilevel inheritance

3 Answers   TCS,


How stl is different from the c++ standard library?

0 Answers  


if 4-5 year old brother is standing on d roof with me and watching d moon, suddenly moon coverd by cloud then how will i explain d hiding of moon to my brother.

8 Answers   MBT,


What is stl in oop?

0 Answers  


Give the output of the following program main() {char *p='a'; int *i=100/*p; } what will be the value of *i= 1

6 Answers   Sun Microsystems,


Categories