This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28487] subclass of a STL class such as list cannot itself be a template class
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jul 2006 00:23:40 -0000
- Subject: [Bug c++/28487] subclass of a STL class such as list cannot itself be a template class
- References: <bug-28487-12860@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-07-26 00:23 -------
list<C>::iterator
You are missing typename in front of that.
The corrected source is:
#include <list>
using namespace std;
template <class C> class D1 : public list<C> {
public:
D1( void ) { typename list<C>::iterator it; }
};
struct T { };
class D2 : public list<T> {
public:
D2( void ) { list<T>::iterator it; }
};
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28487