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 201603 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 #ifdef _GLIBCXX_USE_WCHAR_T 77 template<>
struct __byte_operand<wchar_t> {
using __type = byte; };
79 template<>
struct __byte_operand<char16_t> {
using __type = byte; };
80 template<>
struct __byte_operand<char32_t> {
using __type = byte; };
81 template<>
struct __byte_operand<short> {
using __type = byte; };
82 template<>
struct __byte_operand<unsigned short> {
using __type = byte; };
83 template<>
struct __byte_operand<int> {
using __type = byte; };
84 template<>
struct __byte_operand<unsigned int> {
using __type = byte; };
85 template<>
struct __byte_operand<long> {
using __type = byte; };
86 template<>
struct __byte_operand<unsigned long> {
using __type = byte; };
87 template<>
struct __byte_operand<long long> {
using __type = byte; };
88 template<>
struct __byte_operand<unsigned long long> {
using __type = byte; };
89 #if defined(__GLIBCXX_TYPE_INT_N_0) 90 template<>
struct __byte_operand<__GLIBCXX_TYPE_INT_N_0>
91 {
using __type = byte; };
92 template<>
struct __byte_operand<unsigned __GLIBCXX_TYPE_INT_N_0>
93 {
using __type = byte; };
95 #if defined(__GLIBCXX_TYPE_INT_N_1) 96 template<>
struct __byte_operand<__GLIBCXX_TYPE_INT_N_1>
97 {
using __type = byte; };
98 template<>
struct __byte_operand<unsigned __GLIBCXX_TYPE_INT_N_1>
99 {
using __type = byte; };
101 #if defined(__GLIBCXX_TYPE_INT_N_2) 102 template<>
struct __byte_operand<__GLIBCXX_TYPE_INT_N_2>
103 {
using __type = byte; };
104 template<>
struct __byte_operand<unsigned __GLIBCXX_TYPE_INT_N_2>
105 {
using __type = byte; };
107 template<
typename _IntegerType>
108 struct __byte_operand<const _IntegerType>
109 : __byte_operand<_IntegerType> { };
110 template<
typename _IntegerType>
111 struct __byte_operand<volatile _IntegerType>
112 : __byte_operand<_IntegerType> { };
113 template<
typename _IntegerType>
114 struct __byte_operand<const volatile _IntegerType>
115 : __byte_operand<_IntegerType> { };
117 template<
typename _IntegerType>
118 using __byte_op_t =
typename __byte_operand<_IntegerType>::__type;
120 template<
typename _IntegerType>
121 constexpr __byte_op_t<_IntegerType>&
122 operator<<=(byte& __b, _IntegerType __shift) noexcept
123 {
return __b = byte(static_cast<unsigned char>(__b) << __shift); }
125 template<
typename _IntegerType>
126 constexpr __byte_op_t<_IntegerType>
127 operator<<(byte __b, _IntegerType __shift) noexcept
128 {
return byte(static_cast<unsigned char>(__b) << __shift); }
130 template<
typename _IntegerType>
131 constexpr __byte_op_t<_IntegerType>&
132 operator>>=(byte& __b, _IntegerType __shift) noexcept
133 {
return __b = byte(static_cast<unsigned char>(__b) >> __shift); }
135 template<
typename _IntegerType>
136 constexpr __byte_op_t<_IntegerType>
137 operator>>(byte __b, _IntegerType __shift) noexcept
138 {
return byte(static_cast<unsigned char>(__b) >> __shift); }
141 operator|=(byte& __l, byte __r) noexcept
144 byte(static_cast<unsigned char>(__l) | static_cast<unsigned char>(__r));
151 byte(static_cast<unsigned char>(__l) | static_cast<unsigned char>(__r));
155 operator&=(byte& __l, byte __r) noexcept
158 byte(static_cast<unsigned char>(__l) & static_cast<unsigned char>(__r));
165 byte(static_cast<unsigned char>(__l) & static_cast<unsigned char>(__r));
169 operator^=(byte& __l, byte __r) noexcept
172 byte(static_cast<unsigned char>(__l) ^ static_cast<unsigned char>(__r));
179 byte(static_cast<unsigned char>(__l) ^ static_cast<unsigned char>(__r));
183 operator~(byte __b) noexcept
184 {
return byte(~static_cast<unsigned char>(__b)); }
186 template<
typename _IntegerType>
187 constexpr _IntegerType
188 to_integer(__byte_op_t<_IntegerType> __b) noexcept
189 {
return _IntegerType(__b); }
191 _GLIBCXX_END_NAMESPACE_VERSION
196 #endif // _GLIBCXX_CSTDDEF
ISO C++ entities toplevel namespace is std.
bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
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.
bitset< _Nb > operator &(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.