Explain: A template function is not a function
Quote:
A
template function is not a function. The prototype for a template function is
maximum<T>(T, T). The function that this template creates when T is int is
the function (not template function) maximum(int, int).
I picked up this from a book. It says
Quote:
The main() function implicitly causes C++ to create two versions of maximum()
How does C++ create the versions of the template maximum() ?
Can you give me an example ?
Quote:
Creating a function from a template is called instantiating the template.
Secondly, C++ does itself create a function from a template or do we have to do it somehow ?