Problem with inner class

Discussion in 'C++' started by pazabo@gmail.com, Nov 29, 2006.

  1. Guest

    Hi, I have a problem with this class (I omitted unimportant parts):

    template <class T> class mylist {
    public:
    class iterator;

    iterator getIterator();
    // ...
    };

    template <class T> class mylist<T>::iterator {
    // ...
    };

    template <class T> iterator mylist<T>::getIterator() {
    // ...
    }

    and GCC says:
    "error: expected constructor, destructor, or type conversion before
    'mylist'"
    in line "template <class T> iterator mylist<T>::getIterator() {".

    Does anybody know what does that mean??
     
    , Nov 29, 2006
    #1
    1. Advertising

  2. dasjotre Guest

    wrote:
    > Hi, I have a problem with this class (I omitted unimportant parts):
    > template <class T> iterator mylist<T>::getIterator() {


    template <class T>
    typename mylist<T>::iterator mylist<T>::getIterator()
     
    dasjotre, Nov 29, 2006
    #2
    1. Advertising

  3. Guest

    Ok, thx

    dasjotre wrote:
    > wrote:
    > > Hi, I have a problem with this class (I omitted unimportant parts):
    > > template <class T> iterator mylist<T>::getIterator() {

    >
    > template <class T>
    > typename mylist<T>::iterator mylist<T>::getIterator()
     
    , Nov 29, 2006
    #3
    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. kishan bisht
    Replies:
    2
    Views:
    2,922
    xarax
    Jul 2, 2003
  2. E11
    Replies:
    1
    Views:
    4,774
    Thomas Weidenfeller
    Oct 12, 2005
  3. Carlo v. Dango
    Replies:
    14
    Views:
    1,034
    Alex Martelli
    Oct 19, 2003
  4. Pyenos
    Replies:
    2
    Views:
    388
    Pyenos
    Dec 27, 2006
  5. Fei Liu
    Replies:
    4
    Views:
    356
    Fei Liu
    Jan 8, 2008
Loading...

Share This Page