template <typename T>
typedef struct _Bnode{
int element;
_Bnode<T> * lChild, * rChild;
}Bnode,*Btree;
有谁知道这是为什么吗😥
typedef
不能给模板起别名,但是你可以用C++11的using
给模板起别名。
template <typename T>
struct _Bnode
{
int element;
_Bnode<T> *lChild, *rChild;
};
template <typename T>
using Bnode = _Bnode<T>;
template <typename T>
using Btree = _Bnode<T> *;