39#ifndef _GLIBCXX_CSTDDEF
40#define _GLIBCXX_CSTDDEF 1
42#pragma GCC system_header
45#undef __need_ptrdiff_t
54#if __cplusplus >= 201103L
62#if __cplusplus >= 201703L
65_GLIBCXX_BEGIN_NAMESPACE_VERSION
66#define __cpp_lib_byte 201603L
69 enum class byte :
unsigned char {};
71 template<
typename _IntegerType>
struct __byte_operand { };
72 template<>
struct __byte_operand<bool> {
using __type =
byte; };
73 template<>
struct __byte_operand<char> {
using __type =
byte; };
74 template<>
struct __byte_operand<signed char> {
using __type =
byte; };
75 template<>
struct __byte_operand<unsigned char> {
using __type =
byte; };
76 template<>
struct __byte_operand<wchar_t> {
using __type =
byte; };
77#ifdef _GLIBCXX_USE_CHAR8_T
78 template<>
struct __byte_operand<char8_t> {
using __type =
byte; };
80 template<>
struct __byte_operand<char16_t> {
using __type =
byte; };
81 template<>
struct __byte_operand<char32_t> {
using __type =
byte; };
82 template<>
struct __byte_operand<short> {
using __type =
byte; };
83 template<>
struct __byte_operand<unsigned short> {
using __type =
byte; };
84 template<>
struct __byte_operand<int> {
using __type =
byte; };
85 template<>
struct __byte_operand<unsigned int> {
using __type =
byte; };
86 template<>
struct __byte_operand<long> {
using __type =
byte; };
87 template<>
struct __byte_operand<unsigned long> {
using __type =
byte; };
88 template<>
struct __byte_operand<long long> {
using __type =
byte; };
89 template<>
struct __byte_operand<unsigned long long> {
using __type =
byte; };
90#if defined(__GLIBCXX_TYPE_INT_N_0)
91 template<>
struct __byte_operand<__GLIBCXX_TYPE_INT_N_0>
92 {
using __type =
byte; };
93 template<>
struct __byte_operand<unsigned __GLIBCXX_TYPE_INT_N_0>
94 {
using __type =
byte; };
96#if defined(__GLIBCXX_TYPE_INT_N_1)
97 template<>
struct __byte_operand<__GLIBCXX_TYPE_INT_N_1>
98 {
using __type =
byte; };
99 template<>
struct __byte_operand<unsigned __GLIBCXX_TYPE_INT_N_1>
100 {
using __type =
byte; };
102#if defined(__GLIBCXX_TYPE_INT_N_2)
103 template<>
struct __byte_operand<__GLIBCXX_TYPE_INT_N_2>
104 {
using __type =
byte; };
105 template<>
struct __byte_operand<unsigned __GLIBCXX_TYPE_INT_N_2>
106 {
using __type =
byte; };
108 template<
typename _IntegerType>
109 struct __byte_operand<const _IntegerType>
110 : __byte_operand<_IntegerType> { };
111 template<
typename _IntegerType>
112 struct __byte_operand<volatile _IntegerType>
113 : __byte_operand<_IntegerType> { };
114 template<
typename _IntegerType>
115 struct __byte_operand<const volatile _IntegerType>
116 : __byte_operand<_IntegerType> { };
118 template<
typename _IntegerType>
119 using __byte_op_t =
typename __byte_operand<_IntegerType>::__type;
121 template<
typename _IntegerType>
122 [[__gnu__::__always_inline__]]
123 constexpr __byte_op_t<_IntegerType>
124 operator<<(
byte __b, _IntegerType __shift)
noexcept
125 {
return (
byte)(
unsigned char)((
unsigned)__b << __shift); }
127 template<
typename _IntegerType>
128 [[__gnu__::__always_inline__]]
129 constexpr __byte_op_t<_IntegerType>
130 operator>>(
byte __b, _IntegerType __shift)
noexcept
131 {
return (
byte)(
unsigned char)((
unsigned)__b >> __shift); }
133 [[__gnu__::__always_inline__]]
136 {
return (
byte)(
unsigned char)((
unsigned)__l | (unsigned)__r); }
138 [[__gnu__::__always_inline__]]
141 {
return (
byte)(
unsigned char)((
unsigned)__l & (unsigned)__r); }
143 [[__gnu__::__always_inline__]]
146 {
return (
byte)(
unsigned char)((
unsigned)__l ^ (unsigned)__r); }
148 [[__gnu__::__always_inline__]]
150 operator~(
byte __b)
noexcept
151 {
return (
byte)(
unsigned char)~(
unsigned)__b; }
153 template<
typename _IntegerType>
154 [[__gnu__::__always_inline__]]
155 constexpr __byte_op_t<_IntegerType>&
156 operator<<=(
byte& __b, _IntegerType __shift)
noexcept
157 {
return __b = __b << __shift; }
159 template<
typename _IntegerType>
160 [[__gnu__::__always_inline__]]
161 constexpr __byte_op_t<_IntegerType>&
162 operator>>=(
byte& __b, _IntegerType __shift)
noexcept
163 {
return __b = __b >> __shift; }
165 [[__gnu__::__always_inline__]]
167 operator|=(
byte& __l,
byte __r)
noexcept
168 {
return __l = __l | __r; }
170 [[__gnu__::__always_inline__]]
172 operator&=(
byte& __l,
byte __r)
noexcept
173 {
return __l = __l & __r; }
175 [[__gnu__::__always_inline__]]
177 operator^=(
byte& __l,
byte __r)
noexcept
178 {
return __l = __l ^ __r; }
180 template<
typename _IntegerType>
181 [[nodiscard,__gnu__::__always_inline__]]
182 constexpr _IntegerType
183 to_integer(__byte_op_t<_IntegerType> __b)
noexcept
184 {
return _IntegerType(__b); }
186_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.