[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Iterator with template no longer a type in g++3.?
From: |
Maurizio Loreti |
Subject: |
Re: Iterator with template no longer a type in g++3.? |
Date: |
04 Apr 2005 07:48:27 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
Xin Wang <wangxi@yahoo.com> writes:
> I tried to define a class like:
>
> #include<list>
> template <class State>
> class Problem
> {
> .
> .
> .
> list<State>::iterator itr;
> .
> .
> .
> }
>
> The compiler keeps on complaining that list<State>::iterator is not a
> type, and itr is not declared. What is wrong here?
> What should I do to avoid this?
Modify the above statement to:
typename std::list<State>::iterator itr;
--
Maurizio Loreti http://www.pd.infn.it/~loreti/mlo.html
Dept. of Physics, Univ. of Padova, Italy ROT13: ybergv@cq.vasa.vg