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

C / C++ / MFC

 
GeneralRe: graph plotting.. Pin
Member 47738778-Mar-08 0:51
Member 47738778-Mar-08 0:51 
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 
Thanks Rajkumar,


1.

I studied your recommended link and it is great. I found some knowledge which I do not have before. Previously, I think only use of the template function will trigger its instantiation, but now I have found at least two ways to explicitly instantise template function, besides the "use of the template function methods". The two methods are,

template<class T> void f(T) { }

template void f<int> (int);


2.

Rajkumar R wrote:
And question, declaration of g() will instantise f<int> (T) is true. since g is non inline non template function.

try commenting the declaration of g(); you will get compilation error, identifier g, not found when instantiating funtion void f<int>(T), otherwise not; this is the proof.


I have tried the following code will not cause any compile errors, using Visual Studio 2008. I doubt whether the declaration of g will trigger the instantiation of template function f?

template <class T> void f(T a) {g (a);}

void g (int a);



regards,
George
GeneralRe: instantiation point discussion Pin
Rajkumar R9-Mar-08 3:01
Rajkumar R9-Mar-08 3:01 
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 

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.