39#ifndef _GLIBCXX_CSTDDEF
40#define _GLIBCXX_CSTDDEF 1
42#pragma GCC system_header
45#undef __need_ptrdiff_t
52#define __glibcxx_want_byte
57#if __cplusplus >= 201103L
68_GLIBCXX_BEGIN_NAMESPACE_VERSION
70 enum class byte :
unsigned char {};
72 template<
typename _IntegerType>
struct __byte_operand { };
73 template<>
struct __byte_operand<bool> {
using __type = byte; };
74 template<>
struct __byte_operand<char> {
using __type = byte; };
75 template<>
struct __byte_operand<signed char> {
using __type = byte; };
76 template<>
struct __byte_operand<unsigned char> {
using __type = byte; };
77 template<>
struct __byte_operand<wchar_t> {
using __type = byte; };
78#ifdef _GLIBCXX_USE_CHAR8_T
79 template<>
struct __byte_operand<char8_t> {
using __type = byte; };
81 template<>
struct __byte_operand<char16_t> {
using __type = byte; };
82 template<>
struct __byte_operand<char32_t> {
using __type = byte; };
83 template<>
struct __byte_operand<short> {
using __type = byte; };
84 template<>
struct __byte_operand<unsigned short> {
using __type = byte; };
85 template<>
struct __byte_operand<int> {
using __type = byte; };
86 template<>
struct __byte_operand<unsigned int> {
using __type = byte; };
87 template<>
struct __byte_operand<long> {
using __type = byte; };
88 template<>
struct __byte_operand<unsigned long> {
using __type = byte; };
89 template<>
struct __byte_operand<long long> {
using __type = byte; };
90 template<>
struct __byte_operand<unsigned long long> {
using __type = byte; };
91#if defined(__GLIBCXX_TYPE_INT_N_0)
92 template<>
struct __byte_operand<__GLIBCXX_TYPE_INT_N_0>
93 {
using __type = byte; };
94 template<>
struct __byte_operand<unsigned __GLIBCXX_TYPE_INT_N_0>
95 {
using __type = byte; };
97#if defined(__GLIBCXX_TYPE_INT_N_1)
98 template<>
struct __byte_operand<__GLIBCXX_TYPE_INT_N_1>
99 {
using __type = byte; };
100 template<>
struct __byte_operand<unsigned __GLIBCXX_TYPE_INT_N_1>
101 {
using __type = byte; };
103#if defined(__GLIBCXX_TYPE_INT_N_2)
104 template<>
struct __byte_operand<__GLIBCXX_TYPE_INT_N_2>
105 {
using __type = byte; };
106 template<>
struct __byte_operand<unsigned __GLIBCXX_TYPE_INT_N_2>
107 {
using __type = byte; };
109 template<
typename _IntegerType>
110 struct __byte_operand<const _IntegerType>
111 : __byte_operand<_IntegerType> { };
112 template<
typename _IntegerType>
113 struct __byte_operand<volatile _IntegerType>
114 : __byte_operand<_IntegerType> { };
115 template<
typename _IntegerType>
116 struct __byte_operand<const volatile _IntegerType>
117 : __byte_operand<_IntegerType> { };
119 template<
typename _IntegerType>
120 using __byte_op_t =
typename __byte_operand<_IntegerType>::__type;
122 template<
typename _IntegerType>
123 [[__gnu__::__always_inline__]]
124 constexpr __byte_op_t<_IntegerType>
125 operator<<(
byte __b, _IntegerType __shift)
noexcept
126 {
return (
byte)(
unsigned char)((
unsigned)__b << __shift); }
128 template<
typename _IntegerType>
129 [[__gnu__::__always_inline__]]
130 constexpr __byte_op_t<_IntegerType>
131 operator>>(
byte __b, _IntegerType __shift)
noexcept
132 {
return (
byte)(
unsigned char)((
unsigned)__b >> __shift); }
134 [[__gnu__::__always_inline__]]
137 {
return (
byte)(
unsigned char)((
unsigned)__l | (unsigned)__r); }
139 [[__gnu__::__always_inline__]]
142 {
return (
byte)(
unsigned char)((
unsigned)__l & (unsigned)__r); }
144 [[__gnu__::__always_inline__]]
147 {
return (
byte)(
unsigned char)((
unsigned)__l ^ (unsigned)__r); }
149 [[__gnu__::__always_inline__]]
151 operator~(
byte __b)
noexcept
152 {
return (
byte)(
unsigned char)~(
unsigned)__b; }
154 template<
typename _IntegerType>
155 [[__gnu__::__always_inline__]]
156 constexpr __byte_op_t<_IntegerType>&
157 operator<<=(
byte& __b, _IntegerType __shift)
noexcept
158 {
return __b = __b << __shift; }
160 template<
typename _IntegerType>
161 [[__gnu__::__always_inline__]]
162 constexpr __byte_op_t<_IntegerType>&
163 operator>>=(
byte& __b, _IntegerType __shift)
noexcept
164 {
return __b = __b >> __shift; }
166 [[__gnu__::__always_inline__]]
168 operator|=(
byte& __l,
byte __r)
noexcept
169 {
return __l = __l | __r; }
171 [[__gnu__::__always_inline__]]
173 operator&=(
byte& __l,
byte __r)
noexcept
174 {
return __l = __l & __r; }
176 [[__gnu__::__always_inline__]]
178 operator^=(
byte& __l,
byte __r)
noexcept
179 {
return __l = __l ^ __r; }
181 template<
typename _IntegerType>
182 [[nodiscard,__gnu__::__always_inline__]]
183 constexpr _IntegerType
184 to_integer(__byte_op_t<_IntegerType> __b)
noexcept
185 {
return _IntegerType(__b); }
187_GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
constexpr bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > &__is, bitset< _Nb > &__x)
Global I/O operators for bitsets.
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > &__os, const bitset< _Nb > &__x)
Global I/O operators for bitsets.
constexpr bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
constexpr bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.