agjaisdjfo 2017-01-16 07:03 采纳率: 37.5%
浏览 1643

bitset在VS2010中不能用unsigned long类型初始化

bitset<> 在vs2008中可以用unsigned long类型初始化。
但是在VS2010中,bitset<> 不能用unsigned long初始化。会出现以下错误:

 1>d:\program files\liyu\documents\visual studio 2010\projects\test2010cpp\test2010cpp\main.cpp(14): error C2679: 二进制“=”: 没有找到接受“unsigned long”类型的右操作数的运算符(或没有可接受的转换)
1>          d:\program files (x86)\microsoft visual studio 10.0\vc\include\bitset(511): 可能是“std::bitset<_Bits> &std::bitset<_Bits>::operator =(const std::bitset<_Bits> &)”
1>          with
1>          [
1>              _Bits=32
1>          ]
1>          尝试匹配参数列表“(std::bitset<_Bits>, unsigned long)”时
1>          with
1>          [
1>              _Bits=32
1>          ]

请各位指点一下,十分感谢。

  • 写回答

1条回答 默认 最新

  • 坤昱 《一起学习C语言》专栏作者 2017-01-18 11:07
    关注

    没有指定位数!!!!

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型