Click here to Skip to main content
16,005,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: templates Pin
Christian Graus18-Jun-02 14:23
protectorChristian Graus18-Jun-02 14:23 
GeneralRe: templates Pin
Ancient Dragon18-Jun-02 14:41
Ancient Dragon18-Jun-02 14:41 
GeneralRe: templates Pin
Christian Graus18-Jun-02 14:51
protectorChristian Graus18-Jun-02 14:51 
GeneralRe: templates Pin
Michael Dunn18-Jun-02 15:32
sitebuilderMichael Dunn18-Jun-02 15:32 
GeneralRe: templates Pin
Kannan Kalyanaraman18-Jun-02 16:51
Kannan Kalyanaraman18-Jun-02 16:51 
GeneralRe: templates Pin
Mike Nordell18-Jun-02 17:40
Mike Nordell18-Jun-02 17:40 
GeneralRe: templates Pin
Kannan Kalyanaraman18-Jun-02 22:17
Kannan Kalyanaraman18-Jun-02 22:17 
GeneralRe: templates Pin
Michael Dunn18-Jun-02 19:35
sitebuilderMichael Dunn18-Jun-02 19:35 
Yes, specialization is supported. It's essentially overloading a template for a specific set of template params. Partial template specialization is one that's not supported (maybe it is "partially" - I still don't understand how it works).
template class CFoo<typename T>
{
public:
  void DoStuff ( T t ) { ... }
};
 
// Now, specialize CFoo for chars
template<> class CFoo<char>
{
public:
  void DoStuff ( char ch ) { FormatDrive(ch); }
};
 
main()
{
CFoo<int> foo_int;    // instantiates CFoo<int>
CFoo<char> foo_char;  // uses explicit specialization of CFoo<char>
 
  foo_int.DoStuff(42);      // does stuff...
  foo_char.DoStuff('C');    // D'OH!
}
I think I have all the syntax right... templates are a PITA sometimes. Wink | ;)

--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm

QuestionHow do i implement drag and drop in a List Control in my Win32 app (non-MFC)? Pin
redeemer18-Jun-02 11:15
redeemer18-Jun-02 11:15 
Generallinked lists in Win32 App Pin
18-Jun-02 11:06
suss18-Jun-02 11:06 
GeneralRe: linked lists in Win32 App Pin
Bill Wilson18-Jun-02 11:08
Bill Wilson18-Jun-02 11:08 
QuestionHow to convert from a CString Object to double Pin
Speedy18-Jun-02 10:36
Speedy18-Jun-02 10:36 
AnswerRe: How to convert from a CString Object to double Pin
Abin18-Jun-02 10:42
Abin18-Jun-02 10:42 
AnswerRe: How to convert from a CString Object to double Pin
Maxwell Chen18-Jun-02 15:59
Maxwell Chen18-Jun-02 15:59 
Generalfixed window as in VB Pin
slah18-Jun-02 10:30
slah18-Jun-02 10:30 
GeneralRe: fixed window as in VB Pin
Mike Nordell18-Jun-02 16:14
Mike Nordell18-Jun-02 16:14 
GeneralRe: fixed window as in VB Pin
slah19-Jun-02 10:57
slah19-Jun-02 10:57 
GeneralDeleting elements from a character array Pin
JMajors9818-Jun-02 9:56
JMajors9818-Jun-02 9:56 
GeneralRe: Deleting elements from a character array Pin
Speedy18-Jun-02 10:31
Speedy18-Jun-02 10:31 
GeneralRe: Deleting elements from a character array Pin
JMajors9818-Jun-02 11:12
JMajors9818-Jun-02 11:12 
GeneralRe: Deleting elements from a character array Pin
18-Jun-02 11:16
suss18-Jun-02 11:16 
GeneralRe: Deleting elements from a character array Pin
Joaquín M López Muñoz18-Jun-02 11:28
Joaquín M López Muñoz18-Jun-02 11:28 
GeneralJavascript and ActiveX Pin
calebcohoon18-Jun-02 9:22
calebcohoon18-Jun-02 9:22 
GeneralRe: javascript and ActiveX Pin
18-Jun-02 9:27
suss18-Jun-02 9:27 
GeneralRe: javascript and ActiveX Pin
calebcohoon18-Jun-02 9:49
calebcohoon18-Jun-02 9:49 

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.