[英]std::bitset::at() disappear in VS2015
I used to use bitset::at(x)
, the robust runtime checked version to check if any bit from a bitset<>
is set. 我曾经使用
bitset::at(x)
,它是功能强大的运行时检查版本,用于检查是否设置了bitset<>
任何位。 But in VS2015, I am getting this error: 但是在VS2015中,我收到此错误:
std::bitset<6> bTestFlag;
int b = bTestFlag.at(3); // Error C2039 'at': is not a member of 'std::bitset<6>'
Why did it disappear in VS2015? 为什么它在VS2015中消失了?
You're probably looking for std::bitset::test()
. 您可能正在寻找
std::bitset::test()
。 That is the correct member function that checks a bit, but throws std::out_of_range
if the provided index isn't a valid position. 那是检查一点的正确成员函数,但是如果提供的索引不是有效位置,则抛出
std::out_of_range
。 There was never an at()
. 从来没有
at()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.