Iterator of STL vector of a template arg fails!

Discussion in 'C++' started by =?ISO-8859-15?Q?R=FCdiger_Kn=F6rig?=, Jun 2, 2005.

  1. 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? :-(
     
    =?ISO-8859-15?Q?R=FCdiger_Kn=F6rig?=, Jun 2, 2005
    #1
    1. Advertisements

  2. Rapscallion wrote:

    > Rüdiger Knörig wrote:
    >> I've a nasty problem here (g++ 3.4/4.0):

    > ...
    >> vector< mltreenode<T> * >::iterator worst_elem;
    >> I got the compiler error:
    >> "Fehler: expected `;' before »worst_elem«"

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

    Thank you very much!!!!
     
    =?ISO-8859-15?Q?R=FCdiger_Kn=F6rig?=, Jun 2, 2005
    #2
    1. Advertisements

  3. =?ISO-8859-15?Q?R=FCdiger_Kn=F6rig?=

    Rapscallion Guest

    Rüdiger Knörig wrote:
    > I've a nasty problem here (g++ 3.4/4.0):

    ....
    > vector< mltreenode<T> * >::iterator worst_elem;
    > I got the compiler error:
    > "Fehler: expected `;' before »worst_elem«"


    typename vector< mltreenode<T> * >::iterator worst_elem;
     
    Rapscallion, Jun 2, 2005
    #3
  4. =?ISO-8859-15?Q?R=FCdiger_Kn=F6rig?=

    Rapscallion Guest

    Rapscallion, Jun 2, 2005
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    2,313
    Csaba
    Feb 18, 2006
  2. T. Crane

    STL vector iterator question

    T. Crane, Sep 4, 2007, in forum: C++
    Replies:
    5
    Views:
    598
    T. Crane
    Sep 5, 2007
  3. David Bilsby
    Replies:
    5
    Views:
    2,369
    David Bilsby
    Oct 9, 2007
  4. n00m
    Replies:
    5
    Views:
    516
  5. Steve555
    Replies:
    12
    Views:
    1,159
    James Kanze
    Dec 29, 2008
  6. zl2k
    Replies:
    27
    Views:
    1,931
    Francesco S. Carta
    Sep 7, 2010
  7. Replies:
    7
    Views:
    407
  8. Replies:
    21
    Views:
    738
    Barry Schwarz
    Mar 5, 2014
Loading...