Ошибка параметра шаблона g ++

У меня есть функция GetContainer () следующим образом.

template<typename I,typename T,typename Container>
Container& ObjCollection<I,T,Container>::GetContainer()
{
    return mContainer;
}

Когда я использую этот метод следующим образом

template<typename I,typename T>
T& DynamicObjCollection<I,T>::Insert(T& t)
{
    GetContainer().insert(&t);
    return t;
}

, я получаю ошибки.

error: there are no arguments to ‘GetContainer’ that depend on a template parameter, 
so a declaration of ‘GetContainer’ must be available

error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of 
an undeclared name is deprecated)

Он отлично работает с MSVC, но g ++ не такой допустимый. Что не так с кодом?

16
задан prosseek 23 October 2013 в 13:32
поделиться