How can you force instantiation of a template?



How can you force instantiation of a template?..

Answer / bhargavi

You can force the instantiation of a specialization of the
template by specifying a prototype somewhere in your code.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is the importance of mutable keyword?

0 Answers  


Which one is better- macro or function?

0 Answers   Fidelity,


what is a reference variable in C++?

0 Answers  


1)#include <iostream.h> int main() { int *a, *savea, i; savea = a = (int *) malloc(4 * sizeof(int)); for (i=0; i<4; i++) *a++ = 10 * i; for (i=0; i<4; i++) { printf("%d\n", *savea); savea += sizeof(int); } return 0; } 2)#include <iostream.h> int main() { int *a, *savea, i; savea = a = (int *) malloc(4 * sizeof(int)); for (i=0; i<4; i++) *a++ = 10 * i; for (i=0; i<4; i++) { printf("%d\n", *savea); savea ++; } return 0; } The output of this two programs will be different why?

5 Answers  


What are advantages of c++?

0 Answers  






Is c++ an oop?

0 Answers  


What is the use of 'using' declaration in c++?

0 Answers  


Write a function that swaps the values of two integers, using int* as the argument type?

0 Answers  


I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.

0 Answers  


What is virtual table?

0 Answers  


What is token c++?

0 Answers  


How can virtual functions in c++ be implemented?

0 Answers  


Categories