Connecting Tech Pros Worldwide Help | Site Map

Iterator of STL vector of a template arg fails!

  #1  
Old July 23rd, 2005, 05:59 AM
Rüdiger Knörig
Guest
 
Posts: n/a
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? :-(


  #2  
Old July 23rd, 2005, 05:59 AM
Rapscallion
Guest
 
Posts: n/a

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;

  #3  
Old July 23rd, 2005, 05:59 AM
Rüdiger Knörig
Guest
 
Posts: n/a

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!!!!
  #4  
Old July 23rd, 2005, 05:59 AM
Rapscallion
Guest
 
Posts: n/a

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