#include "stdafx.h"
#include<stdexcept>
#ifndef ToozyBinaryTreeHead
#define ToozyBinaryTreeHead
template <class T>
class ToozyBinaryTree{
public:
typedef bool (*findFunc)(typename const ToozyBinaryTree<T>::ToozyBinaryTreeNode*,const T*);
static const int LEFT = 1;
static const int RIGHT = 2;
struct ToozyBinaryTreeNode{
ToozyBinaryTreeNode *left;
ToozyBinaryTreeNode *right;
ToozyBinaryTreeNode *nextNode;
T value;
ToozyBinaryTreeNode(const T *v){
value = *v;
left = nullptr;
right = nullptr;
nextNode = nullptr;
}
};
findFunc findFunction;
ToozyBinaryTree(ToozyBinaryTreeNode *root);
ToozyBinaryTree(T *v);
~ToozyBinaryTree();
const ToozyBinaryTreeNode *find(const T *value) const;
const ToozyBinaryTreeNode *add(const ToozyBinaryTreeNode *parent,const T *value,int type);
const ToozyBinaryTreeNode *getRoot();
protected:
ToozyBinaryTreeNode* _root;
ToozyBinaryTreeNode* _lastNode;
};
typedef bool (findFunc)(typename const ToozyBinaryTree::ToozyBinaryTreeNode,const T*);
应该怎么改?
typedef bool (findFunc)(typename const ToozyBinaryTree::ToozyBinaryTreeNode,const T*);
改为bool (findFunc)(typename const ToozyBinaryTree::ToozyBinaryTreeNode,const T*);
typedef的用法不是这样用的。去查查type的用法吧。
findFunc findFunction;这句多余了。去掉
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。