- cstddef[meta header]
- std[meta namespace]
- function[meta id-type]
- cpp17[meta cpp]
namespace std {
constexpr byte& operator|=(byte& l, byte r) noexcept;
}
byte
型のオブジェクトに対して、ビット論理和の複合代入をする。
以下の式と等価の効果をもつ:
return l = l | r;
投げない
#include <cassert>
#include <cstddef>
int main()
{
std::byte a{0b0000'0011};
std::byte b{0b0000'0101};
a |= b;
assert(static_cast<unsigned char>(a) == 0b0000'0111);
}
- C++17
- Clang, C++17 mode: 5.0
- GCC, C++17 mode: 7.1
- Visual C++: ??