Итератор имени типа шаблона C++

Рассмотрим следующий заголовочный файл:

template <typename T> struct tNode
{
    T Data;                      //the data contained within this node
    list<tNode<T>*> SubNodes;       //a list of tNodes pointers under this tNode

    tNode(const T& theData)
    //PRE:  theData is initialized
    //POST: this->data == theData and this->SubNodes have an initial capacity
    //      equal to INIT_CAPACITY, it is set to the head of SubNodes
    {
        this->Data = theData;
        SubNodes(INIT_CAPACITY);   //INIT_CAPACITY is 10
    }

};

Теперь рассмотрим строку кода из другого файла:

list<tNode<T>*>::iterator it();  //iterate through the SubNodes

Компилятор выдает мне это сообщение об ошибке:Tree.h:38:17: error: need ‘typename’ before ‘std::list<tNode<T>*>::iterator’ because ‘std::list<tNode<T>*>’ is a dependent scope

Я понятия не имею, почему компилятор кричит на меня за это.

39
задан Adam Stelmaszczyk 28 November 2015 в 15:55
поделиться