Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WaitForMultipleObjects().. Pin
gokings3-Aug-04 20:50
gokings3-Aug-04 20:50 
GeneralRe: WaitForMultipleObjects().. Pin
Laing,James3-Aug-04 22:22
Laing,James3-Aug-04 22:22 
GeneralRe: WaitForMultipleObjects().. Pin
Laing,James4-Aug-04 7:23
Laing,James4-Aug-04 7:23 
QuestionHow Many Timers can run on a dialog Pin
Member 12742903-Aug-04 9:00
Member 12742903-Aug-04 9:00 
AnswerRe: How Many Timers can run on a dialog Pin
T1TAN3-Aug-04 11:05
T1TAN3-Aug-04 11:05 
GeneralRe: How Many Timers can run on a dialog Pin
Member 12742903-Aug-04 11:33
Member 12742903-Aug-04 11:33 
AnswerRe: How Many Timers can run on a dialog Pin
Michael Dunn3-Aug-04 13:13
sitebuilderMichael Dunn3-Aug-04 13:13 
Generalfunction templates - C++ standard vs. VC6 Pin
peterchen3-Aug-04 8:54
peterchen3-Aug-04 8:54 
I see the following behavior under VC6:

template <class T> void foo()
{
   printf("sizeof(..)=%i\n", sizeof(T));
}


int main(int argc, char * argv[])
{
   foo<BYTE>();  // (*) prints 4 !!!!
   foo<float>(); // prints 4
   return 0;
}


(the real implementation is a bit more complex, it's a bit more complex, seems like at (*) VC6 chooses to call the float variant)

However, when I change the function declaration to

template <class T> void foo(T * p = NULL)
{
   printf("sizeof(..)=%i\n", sizeof(T));
}


it seems to work correctly.

I know that you can't templatize functions by values, only by types - btu that the types must appear in the argument list??!!

Is this (yet another template-related) bug of VC6, or is this what the C++ Standard says?

(I'm pretty much pissed anyway, checking a few dozen templates if they need the T*=NULL trick, but I'd like to know at least if it's my ignorance or the compiler's fault)


we are here to help each other get through this thing, whatever it is Vonnegut jr.

sighist || Agile Programming | doxygen

GeneralRe: function templates - C++ standard vs. VC6 Pin
Chris Losinger3-Aug-04 10:14
professionalChris Losinger3-Aug-04 10:14 
GeneralRe: function templates - C++ standard vs. VC6 Pin
Michael Dunn3-Aug-04 13:16
sitebuilderMichael Dunn3-Aug-04 13:16 
GeneralRe: function templates - C++ standard vs. VC6 Pin
peterchen3-Aug-04 20:05
peterchen3-Aug-04 20:05 
GeneralCalling classes from DLLs Pin
Bisyork3-Aug-04 8:20
Bisyork3-Aug-04 8:20 
GeneralRe: Calling classes from DLLs Pin
Jaime Stuardo3-Aug-04 9:01
Jaime Stuardo3-Aug-04 9:01 
GeneralRe: Calling classes from DLLs Pin
Bisyork3-Aug-04 10:50
Bisyork3-Aug-04 10:50 
GeneralRe: Calling classes from DLLs Pin
Jaime Stuardo3-Aug-04 11:03
Jaime Stuardo3-Aug-04 11:03 
GeneralRe: Calling classes from DLLs Pin
Bisyork3-Aug-04 14:52
Bisyork3-Aug-04 14:52 
GeneralCDatabase && CRecordSet Pin
0v3rloader3-Aug-04 6:38
0v3rloader3-Aug-04 6:38 
GeneralRe: CDatabase &amp;&amp; CRecordSet Pin
Jaime Stuardo3-Aug-04 9:18
Jaime Stuardo3-Aug-04 9:18 
GeneralBut... Pin
0v3rloader3-Aug-04 10:06
0v3rloader3-Aug-04 10:06 
GeneralRe: But... Pin
Jaime Stuardo3-Aug-04 10:15
Jaime Stuardo3-Aug-04 10:15 
GeneralGreat! Pin
0v3rloader3-Aug-04 10:31
0v3rloader3-Aug-04 10:31 
GeneralRe: Great! Pin
Jaime Stuardo3-Aug-04 10:56
Jaime Stuardo3-Aug-04 10:56 
GeneralThanks Pin
0v3rloader3-Aug-04 11:41
0v3rloader3-Aug-04 11:41 
GeneralRe: Thanks Pin
Jaime Stuardo3-Aug-04 14:20
Jaime Stuardo3-Aug-04 14:20 
GeneralRe: Thanks Pin
0v3rloader3-Aug-04 23:09
0v3rloader3-Aug-04 23:09 

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.