다음과 같이 GetContainer() 함수가 있습니다.g ++ 템플릿 매개 변수 오류
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 ++는 그렇게 관대하지 않습니다. 코드에 어떤 문제가 있습니까?
문제를 나타내는 완전한 컴파일 가능한 예제를 게시 할 수 있습니까? –