Connecting Tech Pros Worldwide Help | Site Map

Iterator of STL vector of a template arg fails!

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 04:59 AM
Rüdiger Knörig
Guest
 
Posts: n/a
Default Iterator of STL vector of a template arg fails!

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, 04:59 AM
Rapscallion
Guest
 
Posts: n/a
Default 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, 04:59 AM
Rüdiger Knörig
Guest
 
Posts: n/a
Default 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, 04:59 AM
Rapscallion
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.