输入''无法解决,模板类型

时间:2016-05-01 17:06:48

标签: c++ eclipse

我对编程有点生疏,无法在网上找到解决方案。 我正在创建一个模板类,当使用它时,我似乎得到了错误:

键入' temp'无法解决

我必须尝试清理和重建,但它没有帮助。任何建议都表示赞赏。

  /*
 * avlTREE.h
 *
 *  Created on: May 1, 2016
 *      Author: 
 */

#ifndef AVLTREE_H_
#define AVLTREE_H_
#include <cassert>
#include <functional>


class avlTreeException{};
class avlTreeExceptionInvalidInput : public avlTreeException{};

template <class temp>
class avlTREE{
public:
    temp* ptr;
}
#endif /* AVLTREE_H_ */

1 个答案:

答案 0 :(得分:2)

除了缺少分号外,您的模板类没有任何内在错误。

template <class temp>
class avlTREE{
public:
    temp* ptr;
};

int main(){
  avlTREE<int> foo;
}