Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionTemplate: how to detect type Pin
428825-Apr-10 2:04
428825-Apr-10 2:04 
AnswerRe: Template: how to detect type Pin
Code-o-mat25-Apr-10 3:03
Code-o-mat25-Apr-10 3:03 
AnswerRe: Template: how to detect type Pin
Richard MacCutchan25-Apr-10 3:07
mveRichard MacCutchan25-Apr-10 3:07 
AnswerRe: Template: how to detect type Pin
Saurabh.Garg25-Apr-10 3:42
Saurabh.Garg25-Apr-10 3:42 
AnswerRe: Template: how to detect type Pin
«_Superman_»25-Apr-10 6:55
professional«_Superman_»25-Apr-10 6:55 
AnswerRe: Template: how to detect type Pin
Stuart Dootson25-Apr-10 13:04
professionalStuart Dootson25-Apr-10 13:04 
GeneralRe: Template: how to detect type Pin
428826-Apr-10 2:53
428826-Apr-10 2:53 
AnswerRe: Template: how to detect type Pin
Moak26-Apr-10 4:53
Moak26-Apr-10 4:53 
Hi 4288! My spontaneous reaction was, why does he use templates and not polymorphism... but I wanted to see what others say.

Perhaps it can help you in your design to have an abstract base class CObject and then derive classes from that base class with further specialisation. You would then only need one template for the base class (or if it is about storing data something like std::vector<CObject*>). In C++ virtual methods will be called virtual even via a base class pointer, quite handy. Hard to give better tips without seeing your architecture or requirements. Looks like Saurabh gave the same advice.

Hope it helps... and happy refactoring! Smile | :)
/M

Webchat in Europe Java | [Coffee] Now with 26% more Twitter


QuestionESTREAMIN carriage return Pin
ForNow24-Apr-10 21:52
ForNow24-Apr-10 21:52 
AnswerRe: ESTREAMIN carriage return Pin
Stuart Dootson25-Apr-10 1:31
professionalStuart Dootson25-Apr-10 1:31 
GeneralRe: ESTREAMIN carriage return Pin
ForNow25-Apr-10 2:17
ForNow25-Apr-10 2:17 
Questionhow to get the filepath which is selected? Pin
kobe893624-Apr-10 20:57
kobe893624-Apr-10 20:57 
AnswerRe: how to get the filepath which is selected? Pin
Code-o-mat24-Apr-10 22:16
Code-o-mat24-Apr-10 22:16 
GeneralRe: how to get the filepath which is selected? Pin
kobe893624-Apr-10 22:41
kobe893624-Apr-10 22:41 
GeneralRe: how to get the filepath which is selected? Pin
Code-o-mat24-Apr-10 23:05
Code-o-mat24-Apr-10 23:05 
GeneralRe: how to get the filepath which is selected? Pin
kobe893624-Apr-10 23:47
kobe893624-Apr-10 23:47 
GeneralRe: how to get the filepath which is selected? Pin
Code-o-mat25-Apr-10 0:07
Code-o-mat25-Apr-10 0:07 
GeneralRe: how to get the filepath which is selected? Pin
kobe893625-Apr-10 1:07
kobe893625-Apr-10 1:07 
GeneralRe: how to get the filepath which is selected? Pin
Code-o-mat25-Apr-10 1:23
Code-o-mat25-Apr-10 1:23 
QuestionOpenGL help! Pin
epinez24-Apr-10 16:48
epinez24-Apr-10 16:48 
AnswerRe: OpenGL help! Pin
Tim Craig24-Apr-10 16:58
Tim Craig24-Apr-10 16:58 
GeneralRe: OpenGL help! Pin
epinez24-Apr-10 17:04
epinez24-Apr-10 17:04 
GeneralRe: OpenGL help! Pin
Tim Craig24-Apr-10 19:37
Tim Craig24-Apr-10 19:37 
GeneralRe: OpenGL help! Pin
Cedric Moonen25-Apr-10 1:15
Cedric Moonen25-Apr-10 1:15 
AnswerRe: OpenGL help! Pin
Saurabh.Garg24-Apr-10 17:50
Saurabh.Garg24-Apr-10 17:50 

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.