Aşağıdaki gibi GetContainer() işlevim var.g ++ template parametre hatası
template<typename I,typename T,typename Container>
Container& ObjCollection<I,T,Container>::GetContainer()
{
return mContainer;
}
I hatalarından var
template<typename I,typename T>
T& DynamicObjCollection<I,T>::Insert(T& t)
{
GetContainer().insert(&t);
return t;
}
şöyle ben bu yöntemi kullanın.
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 ile sorunsuz çalışıyor, ancak g ++ buna izin vermiyor. Kodun nesi var?
Sorunu gösteren eksiksiz, tamamlanabilir bir örnek gönderir misiniz? –