Connecting Tech Pros Worldwide Help | Site Map

Iterator of STL vector of a template arg fails!

Rüdiger Knörig
Guest
 
Posts: n/a
#1: Jul 23 '05
I've a nasty problem here (g++ 3.4/4.0):

I've a template datatype mltreenode<T> from which I instanced a STL vector
vector< mltreenode<T> * > without any problems. Calling methods on this
object (e.g. push_back()) doesn't cause any problems. But when I try to
instanciate an iterator like this:
vector< mltreenode<T> * >::iterator worst_elem;
I got the compiler error:
"Fehler: expected `;' before »worst_elem«"

Can anyone help please? :-(


Rapscallion
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Iterator of STL vector of a template arg fails!


Rüdiger Knörig wrote:[color=blue]
> I've a nasty problem here (g++ 3.4/4.0):[/color]
....[color=blue]
> vector< mltreenode<T> * >::iterator worst_elem;
> I got the compiler error:
> "Fehler: expected `;' before »worst_elem«"[/color]

typename vector< mltreenode<T> * >::iterator worst_elem;

Rüdiger Knörig
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Iterator of STL vector of a template arg fails!


Rapscallion wrote:
[color=blue]
> Rüdiger Knörig wrote:[color=green]
>> I've a nasty problem here (g++ 3.4/4.0):[/color]
> ...[color=green]
>> vector< mltreenode<T> * >::iterator worst_elem;
>> I got the compiler error:
>> "Fehler: expected `;' before »worst_elem«"[/color]
>
> typename vector< mltreenode<T> * >::iterator worst_elem;[/color]
Thank you very much!!!!
Rapscallion
Guest
 
Posts: n/a
#4: Jul 23 '05

re: Iterator of STL vector of a template arg fails!


Rüdiger Knörig wrote:[color=blue][color=green]
> > typename vector< mltreenode<T> * >::iterator worst_elem;[/color]
> Thank you very much!!!![/color]

See also:
http://womble.decadentplace.org.uk/c...disambiguation

Closed Thread