Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
错误:'TrieNode::parent' 类型不完整如何解决?请帮助我 TrieNode.h
template <typename T> class TrieNode { public: char subStr; list<TrieNode> childs; TrieNode<T> parent; // error
您可能希望 parent 是指向 TrieNode 而不是实例的指针。
template <typename T> class TrieNode { public: char subStr; list<TrieNode> childs; TrieNode<T> *parent; ...
正如您目前实现的那样, aTrieNode<T>将包含一个 char + a list + TrieNode<T>,也就是说它会无限大。
TrieNode<T>