Another problem with mingw

Started by
0 comments, last by jdhardy 18 years, 10 months ago
I have another problem now..

cStringTree *getNode(list<Character*>strings,int nless=0)
	{
		// Traverse down the tree
		cStringTree<Character,Type> *cnode = this;
		int l = strings.size();
		list<Character*>::iterator it;


On the last line there where I declare the iterator I get: error: expected ';' before "it" Just out of interest I changed Character to char and it worked perfectly... but there shouldn't be a reason for Character causing compilation errors:

template <class Character,class Type>


Any ideas on this one? Thanks, ~SPH
AIM ME: aGaBoOgAmOnGeR
Advertisement
Quote:Original post by ShmeeBegek

Thanks, I have another problem now..
*** Source Snippet Removed ***

On the last line there where I declare the iterator I get:
error: expected ';' before "it"

Just out of interest I changed Character to char and it worked perfectly... but there shouldn't be a reason for Character causing compilation errors:

*** Source Snippet Removed ***

Any ideas on this one? Thanks, ~SPH


cStringTree *getNode(list<Character*>strings,int nless=0)	{		// Traverse down the tree		cStringTree<Character,Type> *cnode = this;		int l = strings.size();		typename list<Character*>::iterator it;

Because Character is a template argument, the compiler doesn't know what list<Character*>::iterator is - it could be a nested type or a static data memeber. Thus, you need to tell the compiler what it's dealing with, which is what the typename keyword does.

This topic is closed to new replies.

Advertisement