首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

bitset<length>怎么编译成功

2012-03-05 
bitsetlength如何编译成功#includebitsettemplatesize_t lengthclass Test{private:bitsetlength

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;} 

热点排行