Click here to Skip to main content
15,890,043 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: is this code right? Pin
Iain Clarke, Warrior Programmer12-Mar-08 1:01
Iain Clarke, Warrior Programmer12-Mar-08 1:01 
QuestionRe: is this code right? Pin
David Crow12-Mar-08 3:11
David Crow12-Mar-08 3:11 
JokeRe: is this code right? [modified] Pin
Justin Perez12-Mar-08 3:51
Justin Perez12-Mar-08 3:51 
GeneralRe: is this code right? Pin
David Crow12-Mar-08 3:56
David Crow12-Mar-08 3:56 
GeneralRe: is this code right? Pin
Rajesh R Subramanian12-Mar-08 3:57
professionalRajesh R Subramanian12-Mar-08 3:57 
GeneralRe: is this code right? Pin
Justin Perez12-Mar-08 3:58
Justin Perez12-Mar-08 3:58 
GeneralRe: is this code right? Pin
gentleguy12-Mar-08 18:11
gentleguy12-Mar-08 18:11 
Generalname binding from one template to another Pin
George_George11-Mar-08 15:16
George_George11-Mar-08 15:16 
Hello everyone,


For non-template function/class, compiler knows the symbol is there and bind to a definite symbol. It is straight forward to understand.

But for a two-step name-lookup compiler, I am curious, how did compiler binds another referred template from one template in the first name lookup step, before instantiation?

Since template symbol is not finalized until it is instantised. But during the first step of compiler look-up, the compiler only sees the definition of template, how could it bind (generate binary code to link to some symbol) (before a referred template is instantised, the real code is not generated)?

For example, in the following code, during the 1st step of name-lookup before function func is instantised, how did compiler work internally to bind to vector<T> (T is not ready at this time, so vector<T> is not instantised)?

Or, I am wrong that compiler will do nothing to bind the referred template, like vector<T> in the sample?

template <class T> void func (T a)
{
    vector<T> vc;
    vc.push_back (a);
    // ...
}



thanks in advance,
George
QuestionHolding focus within Dialog Pin
itechvar11-Mar-08 10:52
itechvar11-Mar-08 10:52 
GeneralRe: Holding focus within Dialog Pin
Ernest Laurentin11-Mar-08 11:52
Ernest Laurentin11-Mar-08 11:52 
AnswerRe: Holding focus within Dialog Pin
itechvar12-Mar-08 8:27
itechvar12-Mar-08 8:27 
QuestionBrowser panel w/o IE? Pin
Peter Weyzen11-Mar-08 8:06
Peter Weyzen11-Mar-08 8:06 
AnswerRe: Browser panel w/o IE? Pin
Randor 11-Mar-08 8:29
professional Randor 11-Mar-08 8:29 
GeneralRe: Browser panel w/o IE? Pin
Peter Weyzen11-Mar-08 9:02
Peter Weyzen11-Mar-08 9:02 
GeneralRe: Browser panel w/o IE? Pin
Randor 11-Mar-08 9:30
professional Randor 11-Mar-08 9:30 
GeneralRe: Browser panel w/o IE? Pin
Peter Weyzen11-Mar-08 22:10
Peter Weyzen11-Mar-08 22:10 
GeneralRe: Browser panel w/o IE? Pin
Demian Panello12-Mar-08 1:11
Demian Panello12-Mar-08 1:11 
GeneralUnable to find definition for CComCriticalSection class Pin
act_x11-Mar-08 7:51
act_x11-Mar-08 7:51 
GeneralRe: Unable to find definition for CComCriticalSection class Pin
Maxwell Chen11-Mar-08 7:56
Maxwell Chen11-Mar-08 7:56 
GeneralRe: Unable to find definition for CComCriticalSection class Pin
Maxwell Chen11-Mar-08 17:45
Maxwell Chen11-Mar-08 17:45 
QuestionHow to get double pointers address? Pin
Gofur Halmurat11-Mar-08 4:11
Gofur Halmurat11-Mar-08 4:11 
AnswerRe: How to get double pointers address? Pin
Rajkumar R11-Mar-08 4:14
Rajkumar R11-Mar-08 4:14 
GeneralThe instruction at 0x00427289 referenced memory at 0x7ffdf000. The memory could not be read. Pin
ganesa moorthy11-Mar-08 3:31
ganesa moorthy11-Mar-08 3:31 
GeneralRe: The instruction at 0x00427289 referenced memory at 0x7ffdf000. The memory could not be read. Pin
Rajkumar R11-Mar-08 3:35
Rajkumar R11-Mar-08 3:35 
GeneralOT Pin
CPallini11-Mar-08 3:40
mveCPallini11-Mar-08 3:40 

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.