转换。bitset的位右侧位置指定数目的并返回相应结果到目标的bitset。
bitset<N>& operator>>=(
size_t _Pos
);
参数
- _Pos
位置的数量右侧位在bitset将转换。
返回值
已修改的目标bitset,以便个已转换的右侧位置所需的数目。
备注
如果元素不存在转换到的位置,函数清除位为值0。
示例
// bitset_op_RSE.cpp
// compile with: /EHsc
#include <bitset>
#include <iostream>
int main( )
{
using namespace std;
bitset<5> b1 ( 28 );
cout << "The target bitset b1 is: ( "<< b1 << " )." << endl;
b1 >>= 2;
cout << "After shifting the bits 2 positions to the right,\n"
<< " the target bitset b1 becomes: ( "<< b1 << " )."
<< endl;
}
要求
标头: <bitset>
命名空间: std