Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 843 Bytes

File metadata and controls

51 lines (35 loc) · 843 Bytes

operator>>=

  • bitset[meta header]
  • std[meta namespace]
  • bitset[meta class]
  • function[meta id-type]
bitset<N>& operator>>=(size_t pos);                    // (1) C++03
bitset<N>& operator>>=(size_t pos) noexcept;           // (1) C++11
constexpr bitset<N>& operator>>=(size_t pos) noexcept; // (1) C++23

概要

ビットを右シフトさせる。

効果

*thisのビットをposの個数だけ右にシフトさせる。溢れたビットは0になる。

戻り値

*this

例外

投げない。

#include <iostream>
#include <bitset>

int main()
{
  std::bitset<8> bs("11000001");

  bs >>= 4;

  std::cout << bs << std::endl;
}

出力

00001100

参照