读书人

bitsetlt;lengthgt;怎么编译成功

发布时间: 2012-03-05 11:54:01 作者: rapoo

bitset<length>如何编译成功
#include<bitset>

template<size_t length>
class Test
{
private:
bitset<length> _bitset;
};

以上代码如何修改才能编译成功?
我希望能够这样使用它:Test<100> test;

希望大家帮忙解决,十分紧急.

[解决办法]

C/C++ code
#include <iostream>#include <bitset> using namespace std;template <size_t length> class Test {     private:         bitset <length> _bitset; };int main(){    Test<5> test;    return 0;}
[解决办法]
C/C++ code
#include <iostream>#include <bitset> using namespace std;template <size_t length> class Test { private :     bitset <length> _bitset; };int main() {        Test<100> test;    return 0;} 

读书人网 >C++

热点推荐