Hi all,
Following are some doubts regarding templates
1. When i say that the template is instatiating, i need the concrete type to instantiate the template. i am not clear on this as to what types i refer to be concrete. Extending this when i have the following code
In the code snippet above, does the statement means that the pointer type is also the concrete type ????
2. it is said that the template functions have external linkage normally. what is the reason behind this ?
thanks in advance
sanjay
Following are some doubts regarding templates
1. When i say that the template is instatiating, i need the concrete type to instantiate the template. i am not clear on this as to what types i refer to be concrete. Extending this when i have the following code
Code:
//File.h
template <typename T>
void foo(T temp) {
// some code here
}
//FileMain.cpp
int i = 40;
int *ptr = &i;
foo(ptr);
2. it is said that the template functions have external linkage normally. what is the reason behind this ?
thanks in advance
sanjay