Click here to Skip to main content
15,912,507 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Bjarne's member function binding sample is wrong? Pin
George_George9-Mar-08 23:48
George_George9-Mar-08 23:48 
AnswerRe: Bjarne's member function binding sample is wrong? [modified] Pin
Maxwell Chen10-Mar-08 1:11
Maxwell Chen10-Mar-08 1:11 
GeneralRe: Bjarne's member function binding sample is wrong? Pin
George_George10-Mar-08 2:29
George_George10-Mar-08 2:29 
GeneralRe: Bjarne's member function binding sample is wrong? Pin
Maxwell Chen10-Mar-08 4:28
Maxwell Chen10-Mar-08 4:28 
GeneralRe: Bjarne's member function binding sample is wrong? Pin
George_George10-Mar-08 19:05
George_George10-Mar-08 19:05 
AnswerRe: Bjarne's member function binding sample is wrong? Pin
David Crow10-Mar-08 3:34
David Crow10-Mar-08 3:34 
GeneralRe: Bjarne's member function binding sample is wrong? Pin
George_George10-Mar-08 3:43
George_George10-Mar-08 3:43 
Generalnon-dependent name in template function Pin
George_George9-Mar-08 16:10
George_George9-Mar-08 16:10 
Hello everyone,


I am confused about what Bjarne means below, and I quoted the section name, his words and his sample.

My question is, what did he mean "A call that by coincidence has an argument that matches an actual template parameter type is not dependent"?

I think the compile error is because, g (1) function call is not dependent on template parameter, and it should be resolved in the definition phase (not instantiation phase) of template function f. But in definition phase of f, what g is (the symbol g) can not be resolved. So comes the compile error.

Is my analysis correct? What did Bjarne mean?

(section C.13.8.1 Dependent Names)

--------------------
A call that by coincidence has an argument that matches an actual template parameter type is not dependent. For example,
--------------------

template <class T> T f (T a)
{
	return g (1); // error: no g() in scope and g(1) doesn't depent on T
}

int g (int);

int z = f (2);



thanks in advance,
George
GeneralVC++ MFC - getting started Pin
Fred Andres9-Mar-08 14:35
Fred Andres9-Mar-08 14:35 
GeneralRe: VC++ MFC - getting started Pin
Christian Graus9-Mar-08 19:45
protectorChristian Graus9-Mar-08 19:45 
GeneralRe: VC++ MFC - getting started Pin
David Crow10-Mar-08 3:43
David Crow10-Mar-08 3:43 
Questionvector.push_back, item disappears [modified] Pin
Anthony Mushrow9-Mar-08 14:26
professionalAnthony Mushrow9-Mar-08 14:26 
GeneralRe: vector.push_back, item disappears Pin
Mark Salsbery9-Mar-08 14:42
Mark Salsbery9-Mar-08 14:42 
GeneralRe: vector.push_back, item disappears Pin
Anthony Mushrow9-Mar-08 14:56
professionalAnthony Mushrow9-Mar-08 14:56 
GeneralRe: vector.push_back, item disappears Pin
Mark Salsbery9-Mar-08 15:05
Mark Salsbery9-Mar-08 15:05 
GeneralRe: vector.push_back, item disappears Pin
Anthony Mushrow9-Mar-08 15:18
professionalAnthony Mushrow9-Mar-08 15:18 
GeneralRe: vector.push_back, item disappears Pin
Mark Salsbery9-Mar-08 15:31
Mark Salsbery9-Mar-08 15:31 
QuestionThe old story of "DEBUG vs RELEASE" Pin
Joseph Marzbani9-Mar-08 5:55
Joseph Marzbani9-Mar-08 5:55 
QuestionRe: The old story of "DEBUG vs RELEASE" Pin
CPallini9-Mar-08 6:16
mveCPallini9-Mar-08 6:16 
GeneralRe: The old story of "DEBUG vs RELEASE" Pin
john56329-Mar-08 21:32
john56329-Mar-08 21:32 
GeneralCopy constructor problem [modified] Pin
followait9-Mar-08 5:48
followait9-Mar-08 5:48 
GeneralRe: Copy constructor problem Pin
CPallini9-Mar-08 5:58
mveCPallini9-Mar-08 5:58 
GeneralRe: Copy constructor problem Pin
Rajkumar R9-Mar-08 20:26
Rajkumar R9-Mar-08 20:26 
GeneralStandalone EXE Pin
ddspliting9-Mar-08 4:21
ddspliting9-Mar-08 4:21 
GeneralOh, they made it again! Pin
CPallini9-Mar-08 5:50
mveCPallini9-Mar-08 5:50 

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.