Click here to Skip to main content
15,888,803 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRemoving IWebBrowser2 'sunken' look Pin
Ritcho4-Sep-04 16:45
Ritcho4-Sep-04 16:45 
GeneralRe: Removing IWebBrowser2 'sunken' look Pin
Neville Franks5-Sep-04 0:40
Neville Franks5-Sep-04 0:40 
GeneralDouble to CString Conversion using fcvt Pin
Charlie Curtis4-Sep-04 16:45
Charlie Curtis4-Sep-04 16:45 
GeneralRe: Double to CString Conversion using fcvt Pin
David Crow4-Sep-04 17:14
David Crow4-Sep-04 17:14 
GeneralRe: Double to CString Conversion using fcvt Pin
Charlie Curtis4-Sep-04 18:19
Charlie Curtis4-Sep-04 18:19 
GeneralC++ Termplate Issue.... Pin
Kandjar4-Sep-04 16:18
Kandjar4-Sep-04 16:18 
I can't compile the following code:

class Foo
{
public:
  template< class T > void F() { T t; }
};

void main()
{
  Foo tmp;
  tmp.F < bool >();
}


The compile raises the error:

<br />
_samples.cpp(10) : error C2275: 'bool' : illegal use of this type as an expression<br />
_samples.cpp(0) : see declaration of 'bool'<br />


It raises the same error if I replace the bool type by a class.
It works if F is not declared as a member function.

It also works fine like this:

class Foo
{
public:
  template<class T> void F(T bool) { T t; }
};

void main()
{
  Foo tmp;
  tmp.F(true);
}


How to do the call to have this working without having the type in param???
GeneralRe: C++ Termplate Issue.... Pin
PJ Arends4-Sep-04 17:15
professionalPJ Arends4-Sep-04 17:15 
GeneralRe: C++ Termplate Issue.... Pin
Kandjar4-Sep-04 18:06
Kandjar4-Sep-04 18:06 
GeneralRe: C++ Termplate Issue.... Pin
PJ Arends4-Sep-04 23:15
professionalPJ Arends4-Sep-04 23:15 
GeneralRe: C++ Termplate Issue.... Pin
Kandjar5-Sep-04 12:26
Kandjar5-Sep-04 12:26 
GeneralRe: C++ Termplate Issue.... Pin
Antti Keskinen5-Sep-04 1:22
Antti Keskinen5-Sep-04 1:22 
GeneralRe: C++ Termplate Issue.... Pin
Kandjar5-Sep-04 11:59
Kandjar5-Sep-04 11:59 
GeneralRe: C++ Termplate Issue.... Pin
Michael Dunn5-Sep-04 6:11
sitebuilderMichael Dunn5-Sep-04 6:11 
GeneralRe: C++ Termplate Issue.... Pin
Kandjar5-Sep-04 12:03
Kandjar5-Sep-04 12:03 
Generalhex digit format Pin
S.W.4-Sep-04 11:32
S.W.4-Sep-04 11:32 
GeneralRe: hex digit format Pin
Archer2824-Sep-04 15:22
Archer2824-Sep-04 15:22 
GeneralRe: hex digit format Pin
S.W.4-Sep-04 15:41
S.W.4-Sep-04 15:41 
GeneralRe: hex digit format Pin
David Crow4-Sep-04 16:37
David Crow4-Sep-04 16:37 
GeneralRe: hex digit format Pin
Archer2825-Sep-04 15:51
Archer2825-Sep-04 15:51 
QuestionWhy doesn't this work? Pin
Nemok4-Sep-04 10:25
Nemok4-Sep-04 10:25 
AnswerRe: Why doesn't this work? Pin
Jörgen Sigvardsson4-Sep-04 10:55
Jörgen Sigvardsson4-Sep-04 10:55 
GeneralRe: Why doesn't this work? Pin
Nemok4-Sep-04 11:11
Nemok4-Sep-04 11:11 
GeneralRe: Why doesn't this work? Pin
Jörgen Sigvardsson4-Sep-04 11:13
Jörgen Sigvardsson4-Sep-04 11:13 
GeneralC++ question. Pin
WREY4-Sep-04 9:55
WREY4-Sep-04 9:55 
GeneralRe: C++ question. Pin
cmk4-Sep-04 11:46
cmk4-Sep-04 11:46 

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.