Q:

In c++,how does the compiler processes a call to a template? 

When we make a call to a template function in c++,i don't understand what special work does the compiler does that at that time due to which it is able to recognize the class with which we have called that template class and then it resolves itself accordingly. 

A:

The answer may depend on the compiler type.  For example, in gcc/clang there is something called two-phase lookup.  But this feature is not implemented in Visual Studio.  This other post on SO gives a good explanation:
Two phase lookup - explanation needed
Also take a look at this post:
c++ complier behaviour using template class

