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

C / C++ / MFC

 
AnswerRe: Incremental search method for CEditview or CRicheditView Pin
Niklas L8-Feb-11 2:52
Niklas L8-Feb-11 2:52 
QuestionResizing controls as per screen resolution Pin
ddgalande8-Feb-11 1:27
ddgalande8-Feb-11 1:27 
AnswerRe: Resizing controls as per screen resolution Pin
Richard MacCutchan8-Feb-11 5:36
mveRichard MacCutchan8-Feb-11 5:36 
GeneralRe: Resizing controls as per screen resolution Pin
ddgalande18-Feb-11 0:18
ddgalande18-Feb-11 0:18 
GeneralRe: Resizing controls as per screen resolution Pin
Richard MacCutchan18-Feb-11 1:42
mveRichard MacCutchan18-Feb-11 1:42 
AnswerRe: Resizing controls as per screen resolution Pin
Cedric Moonen8-Feb-11 20:08
Cedric Moonen8-Feb-11 20:08 
QuestionSortItems function of CListCtrl giving a error Pin
VCProgrammer7-Feb-11 22:26
VCProgrammer7-Feb-11 22:26 
AnswerRe: SortItems function of CListCtrl giving a error Pin
CPallini7-Feb-11 22:41
mveCPallini7-Feb-11 22:41 
GeneralRe: SortItems function of CListCtrl giving a error Pin
VCProgrammer8-Feb-11 0:11
VCProgrammer8-Feb-11 0:11 
GeneralRe: SortItems function of CListCtrl giving a error Pin
CPallini8-Feb-11 0:12
mveCPallini8-Feb-11 0:12 
GeneralRe: SortItems function of CListCtrl giving a error Pin
VCProgrammer8-Feb-11 0:22
VCProgrammer8-Feb-11 0:22 
GeneralRe: SortItems function of CListCtrl giving a error Pin
CPallini8-Feb-11 0:33
mveCPallini8-Feb-11 0:33 
AnswerRe: SortItems function of CListCtrl giving a error Pin
David Crow8-Feb-11 4:27
David Crow8-Feb-11 4:27 
AnswerRe: SortItems function of CListCtrl giving a error Pin
Rolf Kristensen8-Feb-11 9:12
Rolf Kristensen8-Feb-11 9:12 
QuestionViewing fits image in visual c++ Pin
keval5p7-Feb-11 19:39
keval5p7-Feb-11 19:39 
AnswerRe: Viewing fits image in visual c++ Pin
Andrew Brock7-Feb-11 20:14
Andrew Brock7-Feb-11 20:14 
QuestionDesktop rect Pin
includeh107-Feb-11 7:08
includeh107-Feb-11 7:08 
AnswerRe: Desktop rect Pin
Hans Dietrich7-Feb-11 7:27
mentorHans Dietrich7-Feb-11 7:27 
AnswerRe: Desktop rect Pin
loyal ginger8-Feb-11 2:55
loyal ginger8-Feb-11 2:55 
QuestionNon-Templatized methods in Template Class? Pin
bob169727-Feb-11 4:28
bob169727-Feb-11 4:28 
This is probably a dumb question, but I was examining the vector class source code (Visual C++ 2003) and noticed some method definitions that were confusing me. After some thought, I got on this tangent about template definitions in general and started to question why all the method definitions needed to be "templatized" (for lack of a better word) if some methods never dealt directly with any "typename" for the template.

In other words, if a template method (lets call it "GetVersion") did something simple like return an integer constant, irregardless of any "typename", and the class was instantiated twice, lets say...

CMyClass<int> first;
CMyClass<float> second;


and then somewhere in the code, each instance (first and second) calls "GetVersion", I'm assuming only one copy of "GetVersion" gets created by the compiler.

If this is true, why does the method definition need to "templatized"? Or Does it need to be "templatized"?

The code for vector almost appears to be taking advantage of some technique that only bothers with template syntax for the methods that deal with any typename but I could easily have been deceived. Is it possible to define non-templatized methods in a template class or am I just off my rocker? Or does the compiler require template syntax for every method? (So far, I only get compiler errors if I try to omit template syntax for such methods so I'm guessing I've strayed from reality a bit here but I thought I'd ask anyway)
AnswerRe: Non-Templatized methods in Template Class? Pin
Stefan_Lang7-Feb-11 7:07
Stefan_Lang7-Feb-11 7:07 
AnswerRe: Non-Templatized methods in Template Class? Pin
Stefan_Lang7-Feb-11 22:00
Stefan_Lang7-Feb-11 22:00 
GeneralRe: Non-Templatized methods in Template Class? Pin
bob169728-Feb-11 4:46
bob169728-Feb-11 4:46 
GeneralRe: Non-Templatized methods in Template Class? Pin
Stefan_Lang8-Feb-11 5:09
Stefan_Lang8-Feb-11 5:09 
AnswerRe: Non-Templatized methods in Template Class? Pin
CPallini7-Feb-11 22:13
mveCPallini7-Feb-11 22:13 

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.