Click here to Skip to main content
15,920,629 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalinstantiation point discussion Pin
George_George7-Mar-08 22:24
George_George7-Mar-08 22:24 
GeneralRe: instantiation point discussion Pin
Rajkumar R7-Mar-08 22:43
Rajkumar R7-Mar-08 22:43 
GeneralRe: instantiation point discussion Pin
George_George7-Mar-08 23:01
George_George7-Mar-08 23:01 
GeneralRe: instantiation point discussion Pin
Rajkumar R7-Mar-08 23:23
Rajkumar R7-Mar-08 23:23 
GeneralRe: instantiation point discussion Pin
George_George8-Mar-08 22:03
George_George8-Mar-08 22:03 
GeneralRe: instantiation point discussion Pin
Rajkumar R9-Mar-08 2:07
Rajkumar R9-Mar-08 2:07 
GeneralRe: instantiation point discussion Pin
George_George9-Mar-08 2:24
George_George9-Mar-08 2:24 
GeneralRe: instantiation point discussion Pin
Rajkumar R9-Mar-08 3:01
Rajkumar R9-Mar-08 3:01 
Ahh, Now i read your orginal post and understand the question, i actually missed the following

George_George wrote:

the point of instantiation for f<int>() is just before h(), so the g() called in f() is the global g (int) rather than the local g (double).
--------------------

BTW: from above statement from Bjarne, I think he means declaration of g(int) before h() will instiatise f to f <int>.


I understand from the bjarne's statement is that the point of instantiation is at the template function declaration template <typename T> void f (T) which is before the function h() which is instantised by f<int>() call in h(), since the template deduce functions at the global or namespace scope global g() is taken rather than local g(double).

g(int) won't trigger instantiation of f<int>(), template function instantiation occurs when it is called by special type template arguments. All that reply before was keeping in mind f<int> () is instantiated with g(int) triggered by the call f(int) in h.
GeneralRe: instantiation point discussion Pin
George_George9-Mar-08 3:15
George_George9-Mar-08 3:15 
AnswerRe: instantiation point discussion Pin
Rajkumar R9-Mar-08 3:27
Rajkumar R9-Mar-08 3:27 
GeneralRe: instantiation point discussion Pin
George_George9-Mar-08 15:28
George_George9-Mar-08 15:28 
GeneralMSDN template sample Pin
George_George7-Mar-08 20:36
George_George7-Mar-08 20:36 
GeneralRe: MSDN template sample Pin
CPallini7-Mar-08 23:29
mveCPallini7-Mar-08 23:29 
GeneralRe: MSDN template sample Pin
George_George8-Mar-08 21:59
George_George8-Mar-08 21:59 
GeneralRe: MSDN template sample Pin
CPallini8-Mar-08 22:55
mveCPallini8-Mar-08 22:55 
GeneralRe: MSDN template sample Pin
George_George9-Mar-08 2:05
George_George9-Mar-08 2:05 
GeneralRe: MSDN template sample Pin
CPallini9-Mar-08 3:57
mveCPallini9-Mar-08 3:57 
GeneralRe: MSDN template sample Pin
George_George9-Mar-08 15:22
George_George9-Mar-08 15:22 
GeneralRe: MSDN template sample Pin
CPallini9-Mar-08 22:08
mveCPallini9-Mar-08 22:08 
GeneralRe: MSDN template sample Pin
George_George9-Mar-08 22:35
George_George9-Mar-08 22:35 
QuestionRe: MSDN template sample Pin
CPallini9-Mar-08 22:48
mveCPallini9-Mar-08 22:48 
GeneralRe: MSDN template sample Pin
George_George9-Mar-08 23:41
George_George9-Mar-08 23:41 
Questionneed a very simple compiler written in visual c++!!! Pin
faradgi7-Mar-08 20:18
faradgi7-Mar-08 20:18 
AnswerRe: need a very simple compiler written in visual c++!!! Pin
Rajesh R Subramanian7-Mar-08 20:31
professionalRajesh R Subramanian7-Mar-08 20:31 
GeneralRe: need a very simple compiler written in visual c++!!! Pin
CPallini7-Mar-08 23:24
mveCPallini7-Mar-08 23:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.