C++ 错误 ;2 ;错误C4430:缺少类型说明符-假定为int。注:C++;不支持默认的int向量模板
我被告知要以某种方式完成这项任务。默认情况下,为bitarray生成一个unsigned int模板,向量保存它,但现在我得到了错误C4430C++ 错误 ;2 ;错误C4430:缺少类型说明符-假定为int。注:C++;不支持默认的int向量模板,c++,templates,vector,C++,Templates,Vector,我被告知要以某种方式完成这项任务。默认情况下,为bitarray生成一个unsigned int模板,向量保存它,但现在我得到了错误C4430 #include <vector> template<class IType = unsigned int> class BitArray { private: size_t numbits; size_t capacity; vector<IType> bits; } #包括 样板 类
#include <vector>
template<class IType = unsigned int>
class BitArray {
private:
size_t numbits;
size_t capacity;
vector<IType> bits;
}
#包括
样板
类位数组{
私人:
大小/数量;
容量大小;
矢量位;
}
模板
类位数组{
私人:
大小/数量;
容量大小;
std::向量位;//您必须写入
std::vector<IType> bits;
std::向量位;
std::
在vector
之前缺失?您在哪里使用此类?您还应该有#include
和std::size\u t
。
std::vector<IType> bits;