Click here to Skip to main content
15,891,811 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Reading from file and displaying in screen [modified] Pin
led mike4-Mar-08 9:15
led mike4-Mar-08 9:15 
GeneralRe: Reading from file and displaying in screen Pin
Mark Salsbery4-Mar-08 9:16
Mark Salsbery4-Mar-08 9:16 
GeneralRe: Reading from file and displaying in screen Pin
Hamid_RT3-Mar-08 20:44
Hamid_RT3-Mar-08 20:44 
QuestionRe: Reading from file and displaying in screen Pin
Rajesh R Subramanian3-Mar-08 20:48
professionalRajesh R Subramanian3-Mar-08 20:48 
GeneralRe: Reading from file and displaying in screen Pin
Hamid_RT3-Mar-08 20:59
Hamid_RT3-Mar-08 20:59 
GeneralRe: Reading from file and displaying in screen Pin
David Crow4-Mar-08 2:44
David Crow4-Mar-08 2:44 
GeneralRe: Reading from file and displaying in screen Pin
Rajesh R Subramanian4-Mar-08 5:47
professionalRajesh R Subramanian4-Mar-08 5:47 
Generaltemplate keyword needed Pin
George_George3-Mar-08 18:43
George_George3-Mar-08 18:43 
Hello everyone,


In the Bjarne's book, there is a line of code like this,

typedef typename A::template rebind <Link>::other Link_alloc;


It means if A is allocator, we can use use to allocate arbitrary type of object instance, said by Bjarne.

I understand this statement, my question is about the grammar. Do we need the template keyword? Why?

I have tested without temlpate keyword, the code still works. Any ideas?

template <class T1> class  Foo {
public:
	template <class T2> class Goo {
	public:
		typedef T2	GooValueType;
	};
};

int main()
{
	Foo <int>::Goo<char>::GooValueType a1;
	Foo <int>::template Goo<char>::GooValueType a2;
	return 0;
}



thanks in advance,
George
GeneralRe: template keyword needed Pin
User 5838523-Mar-08 18:54
User 5838523-Mar-08 18:54 
GeneralRe: template keyword needed Pin
George_George3-Mar-08 19:09
George_George3-Mar-08 19:09 
QuestionHow to add a application entry in Windows Firewall Exception list? Pin
Amar Sutar3-Mar-08 17:50
Amar Sutar3-Mar-08 17:50 
AnswerRe: How to add a application entry in Windows Firewall Exception list? Pin
Mark Salsbery4-Mar-08 6:02
Mark Salsbery4-Mar-08 6:02 
Questionhow to do this code? Pin
gentleguy3-Mar-08 17:25
gentleguy3-Mar-08 17:25 
AnswerRe: how to do this code? Pin
uusheikh3-Mar-08 18:26
uusheikh3-Mar-08 18:26 
GeneralRe: how to do this code? [modified] Pin
gentleguy3-Mar-08 19:16
gentleguy3-Mar-08 19:16 
GeneralRe: how to do this code? [modified] Pin
gentleguy3-Mar-08 19:21
gentleguy3-Mar-08 19:21 
AnswerRe: how to do this code? Pin
David Crow4-Mar-08 2:45
David Crow4-Mar-08 2:45 
GeneralGraph Pin
Chandrasekharan P3-Mar-08 17:21
Chandrasekharan P3-Mar-08 17:21 
QuestionHow to Convert HDC to CDC? Pin
TooShy2Talk3-Mar-08 14:49
TooShy2Talk3-Mar-08 14:49 
GeneralRe: How to Convert HDC to CDC? Pin
zzangcorea3-Mar-08 14:53
zzangcorea3-Mar-08 14:53 
GeneralRe: How to Convert HDC to CDC? Pin
Stephen Hewitt3-Mar-08 15:30
Stephen Hewitt3-Mar-08 15:30 
NewsRe: How to Convert HDC to CDC? Pin
Rajkumar R5-Mar-08 19:16
Rajkumar R5-Mar-08 19:16 
GeneralRe: How to Convert HDC to CDC? Pin
Stephen Hewitt3-Mar-08 15:32
Stephen Hewitt3-Mar-08 15:32 
GeneralRe: How to Convert HDC to CDC? Pin
led mike3-Mar-08 16:47
led mike3-Mar-08 16:47 
GeneralRe: How to Convert HDC to CDC? Pin
TooShy2Talk3-Mar-08 16:31
TooShy2Talk3-Mar-08 16:31 

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.