【发布时间】:2011-09-10 18:16:08
【问题描述】:
我的私有类声明中有这个
#include "stdafx.h"
using namespace std;
template <typename Key, typename T>
class A{
//....
private:
static const unsigned int HSIZE = 32;
struct Bucket {
Key key;
T value;
bitset<HSIZE> jumpMap;
};
//....
};
给出以下错误:
Error 1 error C4430: missing type specifier - int assumed
Error 2 error C2059: syntax error : '<'
Error 3 error C2238: unexpected token(s) preceding ';'
当我删除 bitset 行时,它没有给我任何错误。我做错了什么?
编辑:添加更多相关行
【问题讨论】:
-
这是真正的代码吗?因为我看不到
Key、T、HMAX是什么——它们被定义了吗? -
让我添加完整的类声明
-
不需要添加完整的类定义,特别是如果它很长。就是我要的东西:)另外,您是否包含了 bitset 标头并包含了命名空间 std?
-
现在你会这么温柔地添加触发此类错误的模板实例化吗?
标签: c++ visual-c++ struct bitset