将 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