Click here to Skip to main content
15,920,633 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Can I group function (method) within Struct in ANSI C? Pin
Link260018-Sep-04 19:23
Link260018-Sep-04 19:23 
AnswerRe: Can I group function (method) within Struct in ANSI C? Pin
cmk18-Sep-04 21:00
cmk18-Sep-04 21:00 
GeneralRe: Can I group function (method) within Struct in ANSI C? Pin
Anonymous18-Sep-04 18:10
Anonymous18-Sep-04 18:10 
Generalstatic constant template member problems Pin
Andras Zoltan18-Sep-04 12:17
Andras Zoltan18-Sep-04 12:17 
GeneralRe: static constant template member problems Pin
Michael Dunn18-Sep-04 12:56
sitebuilderMichael Dunn18-Sep-04 12:56 
GeneralRe: static constant template member problems Pin
Andras Zoltan19-Sep-04 3:08
Andras Zoltan19-Sep-04 3:08 
GeneralRe: static constant template member problems Pin
Michael Dunn19-Sep-04 11:50
sitebuilderMichael Dunn19-Sep-04 11:50 
GeneralRe: static constant template member problems Pin
Andras Zoltan20-Sep-04 12:25
Andras Zoltan20-Sep-04 12:25 
Mike,

Sometimes, it just helps when someone forces you to look at your code again eh!!? Whilst we've been discussing this, I converted the template class so that it simply used standard members and discovered that there was a general error in some of my logic that was making it appear that these static constants were getting initialised to 1. Of course, however, they weren't - as you've demonstrated and I've just verified.

What didn't help - and I'm not going mad on this one - is that the VC++ debugger picks up these values at run-time as 1 (perhaps understandably, since their values are dependent on the template args), regardless of what value they actually have, therefore I had just assumed that the compiler was stupid, and not me. I should have remembered that the console project is my friend when it comes to debugging values.

Thanks to your help, I have now converted it back to static constants and have received a fifth of a second speed increase over the course of 250,000 operations that will use this class - not much, but enough for me to be happy Big Grin | :-D !

Thanks very much for your help,

Zoltan

I'm not as evil as my name suggests
GeneralRe: static constant template member problems Pin
Michael Dunn20-Sep-04 12:36
sitebuilderMichael Dunn20-Sep-04 12:36 
Questionhow to remove MDI doc template Pin
Igemon18-Sep-04 11:22
Igemon18-Sep-04 11:22 
GeneralDLL debug error message.. Pin
Laing,James18-Sep-04 10:38
Laing,James18-Sep-04 10:38 
GeneralRe: DLL debug error message.. Pin
Tim Smith18-Sep-04 19:17
Tim Smith18-Sep-04 19:17 
GeneralRe: DLL debug error message.. Pin
cmk18-Sep-04 21:17
cmk18-Sep-04 21:17 
QuestionDialog to Tray? Pin
Larsson18-Sep-04 9:44
Larsson18-Sep-04 9:44 
Generaldisplaying the cursor Pin
Member 117092518-Sep-04 9:29
Member 117092518-Sep-04 9:29 
GeneralAdvice needed for a DB project. Pin
crimsongrape18-Sep-04 8:48
crimsongrape18-Sep-04 8:48 
GeneralRe: Advice needed for a DB project. Pin
cmk18-Sep-04 21:25
cmk18-Sep-04 21:25 
GeneralON_CHANGE of CRicheditCtrl works abnormality in windows 98 Pin
Anonymous18-Sep-04 5:57
Anonymous18-Sep-04 5:57 
GeneralTake answer from a user then go to certain string Pin
intilli18-Sep-04 4:43
intilli18-Sep-04 4:43 
QuestionDialog q? Pin
Larsson18-Sep-04 3:29
Larsson18-Sep-04 3:29 
AnswerRe: Dialog q? Pin
Ravi Bhavnani18-Sep-04 7:19
professionalRavi Bhavnani18-Sep-04 7:19 
GeneralRe: Dialog q? Pin
User 665818-Sep-04 7:34
User 665818-Sep-04 7:34 
GeneralRe: Dialog q? Pin
Larsson18-Sep-04 7:50
Larsson18-Sep-04 7:50 
GeneralSmart Card SDK Pin
jsaroj17-Sep-04 20:56
jsaroj17-Sep-04 20:56 
GeneralRe: Smart Card SDK Pin
ThatsAlok17-Sep-04 23:05
ThatsAlok17-Sep-04 23:05 

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.