This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
problem with std::list using own type
- From: Mariano Guadagnini <mariano at uvcms dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 09 Mar 2005 18:02:28 -0300
- Subject: problem with std::list using own type
Hello, i'm new to the list.
I'm developing a multiplatform library, using both Microsoft vc2003 (on
win xp) and GCC 3.3.4 (on Linux), and the following code that compiles
perfectly on vc2003/2005, GCC refuses to doing it:
<-----------------code---------------------->
typedef std::list<AccessItem> AccessList;
typedef std::list<AccessItem>::iterator AccessIt;
<----------------/code---------------------->
where AccessItem is a class defined in the library.Actually, the errors
tha gcc displays are:
error : ISO C++ forbids declaration of `list' with no type
error : template-id `list<AccessItem>' used as a declarator
I cannot find out what i'm doing wrong, I thought that typedef's of
containers was allowed in GCC, in fact, this code worked on other
compilers.... Any idea??
Thanks,
Mariano.