问题描述
问题解答
回答1:template <typename Element>class Node {public: // 加上限定符就好了 typedef Node<Element>* PtrToNode;};int main() { Node<int>::PtrToNode p = new Node<int>; delete p;}回答2:
template <typename Element>class Node {};template <typename Element>using PtrToNode = Node<Element>*;class C {};PtrToNode<C> p;
更多内容见http://en.cppreference.com/w/cpp/language/type_alias