Click here to Skip to main content
16,017,745 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Template function compilation and linking question. Pin
Nelek22-May-07 5:18
protectorNelek22-May-07 5:18 
GeneralRe: Template function compilation and linking question. Pin
jhwurmbach22-May-07 5:30
jhwurmbach22-May-07 5:30 
GeneralRe: Template function compilation and linking question. Pin
Arman S.22-May-07 5:33
Arman S.22-May-07 5:33 
AnswerRe: Template function compilation and linking question. Pin
jhwurmbach22-May-07 5:34
jhwurmbach22-May-07 5:34 
AnswerRe: Template function compilation and linking question. Pin
Arman S.22-May-07 5:43
Arman S.22-May-07 5:43 
AnswerRe: Template function compilation and linking question. Pin
David Crow22-May-07 6:19
David Crow22-May-07 6:19 
AnswerRe: Template function compilation and linking question. Pin
cp987622-May-07 14:47
cp987622-May-07 14:47 
AnswerRe: Template function compilation and linking question. Pin
cmk22-May-07 18:07
cmk22-May-07 18:07 
Just as a class isn't an object,
a template isn't a class/function.

The instance of the template is the class.
The compiler needs to know how to generate the class.
For this it needs access to the template definition.

When you put template code in the C++ file the compiler has nothing to compile because the template isn't a class (it's not compilable source code).

When you use the template to create an instance (a class/function i.e. MyClass::DoSomething<double>) the compiler needs to know, at that point, how to construct the class/function. Because you've put the code in a C++ file it can't see it when it compiles the module that wants to create/use the template instance.

... granted, this is how things are now, people have been talking for a while about getting compilers to 'pre-compile' templates (some how).


...cmk

Save the whales - collect the whole set

AnswerRe: Template function compilation and linking question. Pin
Michael Dunn22-May-07 20:44
sitebuilderMichael Dunn22-May-07 20:44 
GeneralRe: Template function compilation and linking question. Pin
Maximilien23-May-07 13:17
Maximilien23-May-07 13:17 
QuestionMultiple string resources Pin
rrrado22-May-07 4:42
rrrado22-May-07 4:42 
AnswerRe: Multiple string resources Pin
Sameerkumar Namdeo23-May-07 0:51
Sameerkumar Namdeo23-May-07 0:51 
GeneralRe: Multiple string resources Pin
rrrado23-May-07 21:50
rrrado23-May-07 21:50 
QuestionProblems in lock hotkeys like Alt+Tab,Alt+Esc,Ctrl+Alt+Del etc Pin
abhiakude22-May-07 4:18
abhiakude22-May-07 4:18 
QuestionRe: Problems in lock hotkeys like Alt+Tab,Alt+Esc,Ctrl+Alt+Del etc Pin
David Crow22-May-07 6:30
David Crow22-May-07 6:30 
AnswerRe: Problems in lock hotkeys like Alt+Tab,Alt+Esc,Ctrl+Alt+Del etc Pin
abhiakude22-May-07 19:20
abhiakude22-May-07 19:20 
GeneralRe: Problems in lock hotkeys like Alt+Tab,Alt+Esc,Ctrl+Alt+Del etc Pin
David Crow23-May-07 2:53
David Crow23-May-07 2:53 
GeneralRe: Problems in lock hotkeys like Alt+Tab,Alt+Esc,Ctrl+Alt+Del etc Pin
abhiakude24-May-07 21:13
abhiakude24-May-07 21:13 
GeneralRe: Problems in lock hotkeys like Alt+Tab,Alt+Esc,Ctrl+Alt+Del etc Pin
David Crow25-May-07 2:38
David Crow25-May-07 2:38 
QuestionReference Pin
Kiran Pinjala22-May-07 4:18
Kiran Pinjala22-May-07 4:18 
AnswerRe: Reference Pin
Manoj Kumar Rai22-May-07 4:38
professionalManoj Kumar Rai22-May-07 4:38 
GeneralRe: Reference Pin
Arman S.22-May-07 5:13
Arman S.22-May-07 5:13 
AnswerRe: Reference Pin
Arman S.22-May-07 5:18
Arman S.22-May-07 5:18 
AnswerRe: Reference Pin
jhwurmbach22-May-07 5:43
jhwurmbach22-May-07 5:43 
Question[Message Deleted] Pin
dodoxor22-May-07 4:17
dodoxor22-May-07 4:17 

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.