다른 클래스 AVLNode를 포함하는 AVL 클래스를 선언했습니다. AVL 클래스에는 삽입 기능이 포함되어 있습니다. 삽입 AVLNode 포인터를 반환하려면 싶습니다. 이 코드에서 컴파일 오류가 발생합니다. 오류가 무엇입니까?템플릿 매개 변수를 기반으로 한 값 반환
template<class KeyType>
class AVL
{
public:
template<class KeyType>
class AVLNode{};
AVLNode<KeyType>* insert(const KeyType& key);
}
template<class KeyType>
AVLNode<KeyType>* AVL<KeyType>::insert(const KeyType& key)
{
if (m_root == 0)
{
m_root = new AVLNode<KeyType>(key);
return m_root;
}
else
return insert_Helper(key,m_root);
}
컴파일 오류가 무엇과 AVL 트리를 가지고 : 다음은 오류없이 코드는? – hrkz