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 strcture i++ i ++i answer to this i=5 what is the out put

6 Answers  


what is a template?

2 Answers   Amazon, BITS, IBS, Wipro,


In what cases using of a 'template' is a better approach then using of a 'base class'?

6 Answers   Lucent, Mind Tree, Wipro,


What is C++ could you enplane me please?

1 Answers  


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

2 Answers  






How to write a function that goes through an array of characters and eliminates any elements that are not letters (Legal letters can be either in an uppercase or a lowercase format.) The function removeNonLetters should return the new effective size of the array as the result.

2 Answers  


wap in c++ which accept a integer array and its size as argument and replaces element having even values with its half and element having odd values with twice its value

1 Answers  


Is stl part of c++ standard?

0 Answers  


why we are using the fork command?.. how it works?

1 Answers  


why & sign is used in copy constructor

4 Answers  


What does stl mean in slang?

0 Answers  


what is c++

2 Answers  


Categories