vector iterator within a template

Discussion in 'C++' started by Daniel.Wyatt@gmail.com, Dec 30, 2006.

  1. Guest

    I need some help with this please. Here's the important part:

    #include <vector>
    #include <string>
    ................
    template <class T>
    bool ResourceManager<T>::isLoaded(const std::string Filename)
    {
    std::vector<T>::iterator it; //error: expected `;' before "it"
    return false;
    }

    This won't compile. I'm using the newest MinGW, not that it matters. As
    the comment says, the iterator declaration causes an error. I'm pretty
    sure i've encountered this problem before but i can't remember how i
    fixed it. If i replace the "T" template parameter in the iterator
    declaration with a regular type, like an int, it compiles fine.
    , Dec 30, 2006
    #1
    1. Advertising

  2. Guest

    1. Advertising

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. Ken Cecka
    Replies:
    3
    Views:
    7,297
    Ken Cecka
    Mar 27, 2005
  2. =?ISO-8859-15?Q?R=FCdiger_Kn=F6rig?=

    Iterator of STL vector of a template arg fails!

    =?ISO-8859-15?Q?R=FCdiger_Kn=F6rig?=, Jun 2, 2005, in forum: C++
    Replies:
    3
    Views:
    435
    Rapscallion
    Jun 2, 2005
  3. Replies:
    8
    Views:
    1,890
    Csaba
    Feb 18, 2006
  4. dhavalshah

    iterator within iterator

    dhavalshah, Dec 16, 2008, in forum: Java
    Replies:
    0
    Views:
    287
    dhavalshah
    Dec 16, 2008
  5. zl2k
    Replies:
    27
    Views:
    1,552
    Francesco S. Carta
    Sep 7, 2010
Loading...

Share This Page