template <class K, class V>
class A {
class B;
};
template <class K, class V>
class A<K,V>::B {
//other things
};
오류 오류가 발생합니다. 'B'는 클래스 템플릿이 아닙니다. B가 클래스 템플릿이되기 위해 자체적으로 작업하고 있습니다.
B
템플릿이 아닌 클래스 멤버 (클래스 템플릿의 A
) 로 선언 하고 있습니다.
당신이 확인하려면 멤버 템플릿을 , 당신은해야A::B
template <class K, class V>
class A {
template <class T>
class B;
};
template <class K, class V> // for the enclosing class template
template <class T> // for the member template
class A<K,V>::B {
//other things
};
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다