我被告知要以某种方式完成这项任务。为默认情况下为bitarray创建一个unsigned int模板,并且vector保存它,但现在我得到错误C4430。
#include <vector>
template<class IType = unsigned int>
class BitArray {
private:
size_t numbits;
size_t capacity;
vector<IType> bits;
}
答案 0 :(得分:0)
template<class IType = unsigned int>
class BitArray {
private:
size_t numbits;
size_t capacity;
std::vector<IType> bits; // <- add std:: before vector
}; // <- you must add a semicolon
答案 1 :(得分:0)
你必须写
std::vector<IType> bits;