Click here to Skip to main content
16,010,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCProgressCtrl Question Pin
Joel Holdsworth27-Mar-05 8:45
Joel Holdsworth27-Mar-05 8:45 
GeneralRe: CProgressCtrl Question Pin
Steve Mayfield27-Mar-05 9:19
Steve Mayfield27-Mar-05 9:19 
GeneralRe: CProgressCtrl Question Pin
Joel Holdsworth27-Mar-05 9:58
Joel Holdsworth27-Mar-05 9:58 
GeneralRe: CProgressCtrl Question Pin
Ralph Wetzel27-Mar-05 10:10
Ralph Wetzel27-Mar-05 10:10 
GeneralRe: CProgressCtrl Question Pin
Joel Holdsworth27-Mar-05 12:49
Joel Holdsworth27-Mar-05 12:49 
GeneralRe: CProgressCtrl Question Pin
David Crow28-Mar-05 2:51
David Crow28-Mar-05 2:51 
Questiontemplate bug in vc++6? Pin
nm_11427-Mar-05 7:21
nm_11427-Mar-05 7:21 
AnswerRe: template bug in vc++6? Pin
Joaquín M López Muñoz27-Mar-05 9:36
Joaquín M López Muñoz27-Mar-05 9:36 
This is a well known bug in VC++ 6.0: the compiler is blind to template parameters that do not somehow appear as actual arguments of a template function. Hence, foo<1> and foo<2> are treated as the same instantiation.
The following workaround can be applied:
template<int i>
struct int_type
{
};
 
template<int i>
void foo(int_type<i>* dummy=0)
{
  printf("%i\n", i);
}
 
int main(int argc, char* argv[])
{
  foo<1>();
  foo<2>();
  return 0;
}
the dummy argument pulls the i template parameter into the list of arguments of foo, so circumventing the compiler bug. Moreover, as dummy has a default value, you don't need to explicitly mention it when calling foo. Sneaky, isn't it? Wink | ;)

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
GeneralRe: template bug in vc++6? Pin
nm_11427-Mar-05 13:30
nm_11427-Mar-05 13:30 
GeneralArray of Pointers Pin
LighthouseJ27-Mar-05 6:05
LighthouseJ27-Mar-05 6:05 
GeneralRe: Array of Pointers Pin
Gary R. Wheeler27-Mar-05 6:33
Gary R. Wheeler27-Mar-05 6:33 
GeneralRe: Array of Pointers Pin
LighthouseJ27-Mar-05 6:56
LighthouseJ27-Mar-05 6:56 
GeneralRe: Array of Pointers Pin
LighthouseJ27-Mar-05 11:40
LighthouseJ27-Mar-05 11:40 
GeneralRe: Array of Pointers Pin
Axter26-Apr-05 18:07
professionalAxter26-Apr-05 18:07 
GeneralFollow-Up Pin
LighthouseJ27-Mar-05 6:36
LighthouseJ27-Mar-05 6:36 
GeneralRe: Follow-Up Pin
Gary R. Wheeler27-Mar-05 7:01
Gary R. Wheeler27-Mar-05 7:01 
GeneralRe: Array of Pointers Pin
Michael Dunn27-Mar-05 10:41
sitebuilderMichael Dunn27-Mar-05 10:41 
GeneralAES algorithm implementation in VC++ Pin
Member 154898327-Mar-05 4:16
Member 154898327-Mar-05 4:16 
GeneralRe: AES algorithm implementation in VC++ Pin
Michael Dunn27-Mar-05 10:43
sitebuilderMichael Dunn27-Mar-05 10:43 
GeneralRe: AES algorithm implementation in VC++ Pin
Anonymous28-Mar-05 1:27
Anonymous28-Mar-05 1:27 
GeneralLaunching application at startup Pin
Imtiaz Murtaza27-Mar-05 3:33
Imtiaz Murtaza27-Mar-05 3:33 
GeneralRe: Launching application at startup Pin
Gary R. Wheeler27-Mar-05 3:42
Gary R. Wheeler27-Mar-05 3:42 
GeneralRe: Launching application at startup Pin
David Crow28-Mar-05 2:56
David Crow28-Mar-05 2:56 
General.net events from unmanaged code Pin
ischen_s127-Mar-05 2:34
ischen_s127-Mar-05 2:34 
GeneralDLL hook in an .exe Pin
DigitalPenetration27-Mar-05 2:10
DigitalPenetration27-Mar-05 2:10 

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.