Linux cpanel.rrshost.in 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64
Apache
: 109.123.238.221 | : 172.71.255.133
128 Domain
8.2.28
aev999
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
include /
c++ /
11 /
bits /
[ HOME SHELL ]
Name
Size
Permission
Action
algorithmfwd.h
23.97
KB
-rw-r--r--
align.h
3.62
KB
-rw-r--r--
alloc_traits.h
26.98
KB
-rw-r--r--
allocated_ptr.h
3.25
KB
-rw-r--r--
allocator.h
9.51
KB
-rw-r--r--
atomic_base.h
56.07
KB
-rw-r--r--
atomic_futex.h
12.1
KB
-rw-r--r--
atomic_lockfree_defines.h
2.3
KB
-rw-r--r--
atomic_timed_wait.h
13.21
KB
-rw-r--r--
atomic_wait.h
12.26
KB
-rw-r--r--
basic_ios.h
15.7
KB
-rw-r--r--
basic_ios.tcc
5.94
KB
-rw-r--r--
basic_string.h
246.04
KB
-rw-r--r--
basic_string.tcc
52.92
KB
-rw-r--r--
boost_concept_check.h
26.54
KB
-rw-r--r--
c++0x_warning.h
1.44
KB
-rw-r--r--
char_traits.h
28.66
KB
-rw-r--r--
charconv.h
3.35
KB
-rw-r--r--
codecvt.h
24.9
KB
-rw-r--r--
concept_check.h
3.34
KB
-rw-r--r--
cpp_type_traits.h
13.67
KB
-rw-r--r--
cxxabi_forced.h
1.77
KB
-rw-r--r--
cxxabi_init_exception.h
2.17
KB
-rw-r--r--
deque.tcc
41.37
KB
-rw-r--r--
enable_special_members.h
12.16
KB
-rw-r--r--
erase_if.h
2.02
KB
-rw-r--r--
exception.h
2.45
KB
-rw-r--r--
exception_defines.h
1.61
KB
-rw-r--r--
exception_ptr.h
7.46
KB
-rw-r--r--
forward_list.h
49.21
KB
-rw-r--r--
forward_list.tcc
13.71
KB
-rw-r--r--
fs_dir.h
16.02
KB
-rw-r--r--
fs_fwd.h
10.52
KB
-rw-r--r--
fs_ops.h
10.49
KB
-rw-r--r--
fs_path.h
38.81
KB
-rw-r--r--
fstream.tcc
32.88
KB
-rw-r--r--
functexcept.h
3.43
KB
-rw-r--r--
functional_hash.h
8.39
KB
-rw-r--r--
gslice.h
5.39
KB
-rw-r--r--
gslice_array.h
7.71
KB
-rw-r--r--
hash_bytes.h
2.1
KB
-rw-r--r--
hashtable.h
82.96
KB
-rw-r--r--
hashtable_policy.h
60.7
KB
-rw-r--r--
indirect_array.h
7.72
KB
-rw-r--r--
invoke.h
5.92
KB
-rw-r--r--
ios_base.h
31.19
KB
-rw-r--r--
istream.tcc
30.85
KB
-rw-r--r--
iterator_concepts.h
32.55
KB
-rw-r--r--
list.tcc
16.8
KB
-rw-r--r--
locale_classes.h
24.46
KB
-rw-r--r--
locale_classes.tcc
8.18
KB
-rw-r--r--
locale_conv.h
18.38
KB
-rw-r--r--
locale_facets.h
91.46
KB
-rw-r--r--
locale_facets.tcc
39.51
KB
-rw-r--r--
locale_facets_nonio.h
68.07
KB
-rw-r--r--
locale_facets_nonio.tcc
46.42
KB
-rw-r--r--
localefwd.h
5.8
KB
-rw-r--r--
mask_array.h
7.54
KB
-rw-r--r--
max_size_type.h
22.18
KB
-rw-r--r--
memoryfwd.h
2.45
KB
-rw-r--r--
move.h
6.64
KB
-rw-r--r--
nested_exception.h
4.77
KB
-rw-r--r--
node_handle.h
10.66
KB
-rw-r--r--
ostream.tcc
12.03
KB
-rw-r--r--
ostream_insert.h
3.94
KB
-rw-r--r--
parse_numbers.h
7.79
KB
-rw-r--r--
postypes.h
8.27
KB
-rw-r--r--
predefined_ops.h
9.94
KB
-rw-r--r--
ptr_traits.h
6.55
KB
-rw-r--r--
quoted_string.h
4.93
KB
-rw-r--r--
random.h
174.18
KB
-rw-r--r--
random.tcc
103.21
KB
-rw-r--r--
range_access.h
10.46
KB
-rw-r--r--
ranges_algo.h
114.09
KB
-rw-r--r--
ranges_algobase.h
18.43
KB
-rw-r--r--
ranges_base.h
23.82
KB
-rw-r--r--
ranges_cmp.h
5.88
KB
-rw-r--r--
ranges_uninitialized.h
17.71
KB
-rw-r--r--
ranges_util.h
20.11
KB
-rw-r--r--
refwrap.h
12.9
KB
-rw-r--r--
regex.h
101.53
KB
-rw-r--r--
regex.tcc
16.11
KB
-rw-r--r--
regex_automaton.h
10.54
KB
-rw-r--r--
regex_automaton.tcc
7.54
KB
-rw-r--r--
regex_compiler.h
15.84
KB
-rw-r--r--
regex_compiler.tcc
18.71
KB
-rw-r--r--
regex_constants.h
15.18
KB
-rw-r--r--
regex_error.h
4.9
KB
-rw-r--r--
regex_executor.h
8.64
KB
-rw-r--r--
regex_executor.tcc
18.4
KB
-rw-r--r--
regex_scanner.h
6.88
KB
-rw-r--r--
regex_scanner.tcc
14.89
KB
-rw-r--r--
semaphore_base.h
7.75
KB
-rw-r--r--
shared_ptr.h
30.25
KB
-rw-r--r--
shared_ptr_atomic.h
9.64
KB
-rw-r--r--
shared_ptr_base.h
53.62
KB
-rw-r--r--
slice_array.h
9.39
KB
-rw-r--r--
specfun.h
46.13
KB
-rw-r--r--
sstream.tcc
9.91
KB
-rw-r--r--
std_abs.h
3.3
KB
-rw-r--r--
std_function.h
22.33
KB
-rw-r--r--
std_mutex.h
6.29
KB
-rw-r--r--
std_thread.h
8.39
KB
-rw-r--r--
stl_algo.h
209.67
KB
-rw-r--r--
stl_algobase.h
74.47
KB
-rw-r--r--
stl_bvector.h
34.74
KB
-rw-r--r--
stl_construct.h
8.59
KB
-rw-r--r--
stl_deque.h
75.17
KB
-rw-r--r--
stl_function.h
42.87
KB
-rw-r--r--
stl_heap.h
20.27
KB
-rw-r--r--
stl_iterator.h
77
KB
-rw-r--r--
stl_iterator_base_funcs.h
7.99
KB
-rw-r--r--
stl_iterator_base_types.h
9.44
KB
-rw-r--r--
stl_list.h
68.14
KB
-rw-r--r--
stl_map.h
53.41
KB
-rw-r--r--
stl_multimap.h
42.51
KB
-rw-r--r--
stl_multiset.h
36.79
KB
-rw-r--r--
stl_numeric.h
14.26
KB
-rw-r--r--
stl_pair.h
19.66
KB
-rw-r--r--
stl_queue.h
24.45
KB
-rw-r--r--
stl_raw_storage_iter.h
3.74
KB
-rw-r--r--
stl_relops.h
4.49
KB
-rw-r--r--
stl_set.h
37.05
KB
-rw-r--r--
stl_stack.h
12.39
KB
-rw-r--r--
stl_tempbuf.h
8.45
KB
-rw-r--r--
stl_tree.h
72.19
KB
-rw-r--r--
stl_uninitialized.h
33.22
KB
-rw-r--r--
stl_vector.h
64.37
KB
-rw-r--r--
stream_iterator.h
7.52
KB
-rw-r--r--
streambuf.tcc
4.81
KB
-rw-r--r--
streambuf_iterator.h
15.17
KB
-rw-r--r--
string_view.tcc
7
KB
-rw-r--r--
stringfwd.h
2.63
KB
-rw-r--r--
this_thread_sleep.h
3.23
KB
-rw-r--r--
uniform_int_dist.h
12.75
KB
-rw-r--r--
unique_lock.h
6
KB
-rw-r--r--
unique_ptr.h
31.77
KB
-rw-r--r--
unordered_map.h
74.87
KB
-rw-r--r--
unordered_set.h
61.46
KB
-rw-r--r--
uses_allocator.h
6.74
KB
-rw-r--r--
uses_allocator_args.h
7.38
KB
-rw-r--r--
valarray_after.h
22.74
KB
-rw-r--r--
valarray_array.h
20.8
KB
-rw-r--r--
valarray_array.tcc
7.08
KB
-rw-r--r--
valarray_before.h
18.69
KB
-rw-r--r--
vector.tcc
30.26
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : max_size_type.h
// <max_size_type.h> -*- C++ -*- // Copyright (C) 2019-2021 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. /** @file bits/max_size_type.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{iterator} */ #ifndef _GLIBCXX_MAX_SIZE_TYPE_H #define _GLIBCXX_MAX_SIZE_TYPE_H 1 #pragma GCC system_header #if __cplusplus > 201703L && __cpp_lib_concepts #include <ext/numeric_traits.h> #include <numbers> // This header implements unsigned and signed integer-class types (as per // [iterator.concept.winc]) that are one bit wider than the widest supported // integer type. // // The set of integer types we consider includes __int128 and unsigned __int128 // (when they exist), even though they are really integer types only in GNU // mode. This is to obtain a consistent ABI for these integer-class types // across strict mode and GNU mode. namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp> struct numeric_limits; namespace ranges { namespace __detail { class __max_size_type { public: __max_size_type() = default; template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> constexpr __max_size_type(_Tp __i) noexcept : _M_val(__i), _M_msb(__i < 0) { } constexpr explicit __max_size_type(const __max_diff_type& __d) noexcept; template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> constexpr explicit operator _Tp() const noexcept { return _M_val; } constexpr explicit operator bool() const noexcept { return _M_val != 0 || _M_msb != 0; } constexpr __max_size_type operator+() const noexcept { return *this; } constexpr __max_size_type operator~() const noexcept { return __max_size_type{~_M_val, !_M_msb}; } constexpr __max_size_type operator-() const noexcept { return operator~() + 1; } constexpr __max_size_type& operator++() noexcept { return *this += 1; } constexpr __max_size_type operator++(int) noexcept { auto __tmp = *this; ++*this; return __tmp; } constexpr __max_size_type& operator--() noexcept { return *this -= 1; } constexpr __max_size_type operator--(int) noexcept { auto __tmp = *this; --*this; return __tmp; } constexpr __max_size_type& operator+=(const __max_size_type& __r) noexcept { const auto __sum = _M_val + __r._M_val; const bool __overflow = (__sum < _M_val); _M_msb = _M_msb ^ __r._M_msb ^ __overflow; _M_val = __sum; return *this; } constexpr __max_size_type& operator-=(const __max_size_type& __r) noexcept { return *this += -__r; } constexpr __max_size_type& operator*=(__max_size_type __r) noexcept { constexpr __max_size_type __threshold = __rep(1) << (_S_rep_bits / 2 - 1); if (_M_val < __threshold && __r < __threshold) // When both operands are below this threshold then the // multiplication can be safely computed in the base precision. _M_val = _M_val * __r._M_val; else { // Otherwise, perform the multiplication in four steps, by // decomposing the LHS and the RHS into 2*x+a and 2*y+b, // respectively, and computing 4*x*y + 2*x*b + 2*y*a + a*b. const bool __lsb = _M_val & 1; const bool __rlsb = __r._M_val & 1; *this >>= 1; __r >>= 1; _M_val = (2 * _M_val * __r._M_val + _M_val * __rlsb + __r._M_val * __lsb); *this <<= 1; *this += __rlsb * __lsb; } return *this; } constexpr __max_size_type& operator/=(const __max_size_type& __r) noexcept { __glibcxx_assert(__r != 0); if (!_M_msb && !__r._M_msb) [[likely]] _M_val /= __r._M_val; else if (_M_msb && __r._M_msb) { _M_val = (_M_val >= __r._M_val); _M_msb = 0; } else if (!_M_msb && __r._M_msb) _M_val = 0; else if (_M_msb && !__r._M_msb) { // The non-trivial case: the dividend has its MSB set and the // divisor doesn't. In this case we compute ((LHS/2)/RHS)*2 // in the base precision. This quantity is either the true // quotient or one less than the true quotient. const auto __orig = *this; *this >>= 1; _M_val /= __r._M_val; *this <<= 1; if (__orig - *this * __r >= __r) ++_M_val; } return *this; } constexpr __max_size_type& operator%=(const __max_size_type& __r) noexcept { if (!_M_msb && !__r._M_msb) [[likely]] _M_val %= __r._M_val; else *this -= (*this / __r) * __r; return *this; } constexpr __max_size_type& operator<<=(const __max_size_type& __r) noexcept { __glibcxx_assert(__r <= _S_rep_bits); if (__r != 0) { _M_msb = (_M_val >> (_S_rep_bits - __r._M_val)) & 1; if (__r._M_val == _S_rep_bits) [[unlikely]] _M_val = 0; else _M_val <<= __r._M_val; } return *this; } constexpr __max_size_type& operator>>=(const __max_size_type& __r) noexcept { __glibcxx_assert(__r <= _S_rep_bits); if (__r != 0) { if (__r._M_val == _S_rep_bits) [[unlikely]] _M_val = 0; else _M_val >>= __r._M_val; if (_M_msb) [[unlikely]] { _M_val |= __rep(1) << (_S_rep_bits - __r._M_val); _M_msb = 0; } } return *this; } constexpr __max_size_type& operator&=(const __max_size_type& __r) noexcept { _M_val &= __r._M_val; _M_msb &= __r._M_msb; return *this; } constexpr __max_size_type& operator|=(const __max_size_type& __r) noexcept { _M_val |= __r._M_val; _M_msb |= __r._M_msb; return *this; } constexpr __max_size_type& operator^=(const __max_size_type& __r) noexcept { _M_val ^= __r._M_val; _M_msb ^= __r._M_msb; return *this; } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator+=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a + __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator-=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a - __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator*=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a * __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator/=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a / __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator%=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a % __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator&=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a & __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator|=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a | __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator^=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a ^ __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator<<=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a << __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator>>=(_Tp& __a, const __max_size_type& __b) noexcept { return (__a = static_cast<_Tp>(__a >> __b)); } friend constexpr __max_size_type operator+(__max_size_type __l, const __max_size_type& __r) noexcept { __l += __r; return __l; } friend constexpr __max_size_type operator-(__max_size_type __l, const __max_size_type& __r) noexcept { __l -= __r; return __l; } friend constexpr __max_size_type operator*(__max_size_type __l, const __max_size_type& __r) noexcept { __l *= __r; return __l; } friend constexpr __max_size_type operator/(__max_size_type __l, const __max_size_type& __r) noexcept { __l /= __r; return __l; } friend constexpr __max_size_type operator%(__max_size_type __l, const __max_size_type& __r) noexcept { __l %= __r; return __l; } friend constexpr __max_size_type operator<<(__max_size_type __l, const __max_size_type& __r) noexcept { __l <<= __r; return __l; } friend constexpr __max_size_type operator>>(__max_size_type __l, const __max_size_type& __r) noexcept { __l >>= __r; return __l; } friend constexpr __max_size_type operator&(__max_size_type __l, const __max_size_type& __r) noexcept { __l &= __r; return __l; } friend constexpr __max_size_type operator|(__max_size_type __l, const __max_size_type& __r) noexcept { __l |= __r; return __l; } friend constexpr __max_size_type operator^(__max_size_type __l, const __max_size_type& __r) noexcept { __l ^= __r; return __l; } friend constexpr bool operator==(const __max_size_type& __l, const __max_size_type& __r) noexcept { return __l._M_val == __r._M_val && __l._M_msb == __r._M_msb; } #if __cpp_lib_three_way_comparison friend constexpr strong_ordering operator<=>(const __max_size_type& __l, const __max_size_type& __r) noexcept { if (__l._M_msb ^ __r._M_msb) return __l._M_msb ? strong_ordering::greater : strong_ordering::less; else return __l._M_val <=> __r._M_val; } #else friend constexpr bool operator!=(const __max_size_type& __l, const __max_size_type& __r) noexcept { return !(__l == __r); } friend constexpr bool operator<(const __max_size_type& __l, const __max_size_type& __r) noexcept { if (__l._M_msb == __r._M_msb) return __l._M_val < __r._M_val; else return __r._M_msb; } friend constexpr bool operator>(const __max_size_type& __l, const __max_size_type& __r) noexcept { return __r < __l; } friend constexpr bool operator<=(const __max_size_type& __l, const __max_size_type& __r) noexcept { return !(__l > __r); } friend constexpr bool operator>=(const __max_size_type& __l, const __max_size_type& __r) noexcept { return __r <= __l; } #endif #if __SIZEOF_INT128__ using __rep = unsigned __int128; #else using __rep = unsigned long long; #endif static constexpr size_t _S_rep_bits = sizeof(__rep) * __CHAR_BIT__; private: __rep _M_val = 0; unsigned _M_msb:1 = 0; constexpr explicit __max_size_type(__rep __val, int __msb) noexcept : _M_val(__val), _M_msb(__msb) { } friend __max_diff_type; friend std::numeric_limits<__max_size_type>; friend std::numeric_limits<__max_diff_type>; }; class __max_diff_type { public: __max_diff_type() = default; template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> constexpr __max_diff_type(_Tp __i) noexcept : _M_rep(__i) { } constexpr explicit __max_diff_type(const __max_size_type& __d) noexcept : _M_rep(__d) { } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> constexpr explicit operator _Tp() const noexcept { return static_cast<_Tp>(_M_rep); } constexpr explicit operator bool() const noexcept { return _M_rep != 0; } constexpr __max_diff_type operator+() const noexcept { return *this; } constexpr __max_diff_type operator-() const noexcept { return __max_diff_type(-_M_rep); } constexpr __max_diff_type operator~() const noexcept { return __max_diff_type(~_M_rep); } constexpr __max_diff_type& operator++() noexcept { return *this += 1; } constexpr __max_diff_type operator++(int) noexcept { auto __tmp = *this; ++*this; return __tmp; } constexpr __max_diff_type& operator--() noexcept { return *this -= 1; } constexpr __max_diff_type operator--(int) noexcept { auto __tmp = *this; --*this; return __tmp; } constexpr __max_diff_type& operator+=(const __max_diff_type& __r) noexcept { _M_rep += __r._M_rep; return *this; } constexpr __max_diff_type& operator-=(const __max_diff_type& __r) noexcept { _M_rep -= __r._M_rep; return *this; } constexpr __max_diff_type& operator*=(const __max_diff_type& __r) noexcept { _M_rep *= __r._M_rep; return *this; } constexpr __max_diff_type& operator/=(const __max_diff_type& __r) noexcept { __glibcxx_assert (__r != 0); const bool __neg = *this < 0; const bool __rneg = __r < 0; if (!__neg && !__rneg) _M_rep = _M_rep / __r._M_rep; else if (__neg && __rneg) _M_rep = -_M_rep / -__r._M_rep; else if (__neg && !__rneg) _M_rep = -(-_M_rep / __r._M_rep); else _M_rep = -(_M_rep / -__r._M_rep); return *this ; } constexpr __max_diff_type& operator%=(const __max_diff_type& __r) noexcept { __glibcxx_assert (__r != 0); if (*this >= 0 && __r > 0) _M_rep %= __r._M_rep; else *this -= (*this / __r) * __r; return *this; } constexpr __max_diff_type& operator<<=(const __max_diff_type& __r) noexcept { _M_rep.operator<<=(__r._M_rep); return *this; } constexpr __max_diff_type& operator>>=(const __max_diff_type& __r) noexcept { // Arithmetic right shift. const auto __msb = _M_rep._M_msb; _M_rep >>= __r._M_rep; if (__msb) _M_rep |= ~(__max_size_type(-1) >> __r._M_rep); return *this; } constexpr __max_diff_type& operator&=(const __max_diff_type& __r) noexcept { _M_rep &= __r._M_rep; return *this; } constexpr __max_diff_type& operator|=(const __max_diff_type& __r) noexcept { _M_rep |= __r._M_rep; return *this; } constexpr __max_diff_type& operator^=(const __max_diff_type& __r) noexcept { _M_rep ^= __r._M_rep; return *this; } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator+=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a + __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator-=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a - __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator*=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a * __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator/=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a / __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator%=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a % __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator&=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a & __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator|=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a | __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator^=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a ^ __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator<<=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a << __b)); } template<typename _Tp> requires integral<_Tp> || __is_int128<_Tp> friend constexpr _Tp& operator>>=(_Tp& __a, const __max_diff_type& __b) noexcept { return (__a = static_cast<_Tp>(__a >> __b)); } friend constexpr __max_diff_type operator+(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l += __r; return __l; } friend constexpr __max_diff_type operator-(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l -= __r; return __l; } friend constexpr __max_diff_type operator*(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l *= __r; return __l; } friend constexpr __max_diff_type operator/(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l /= __r; return __l; } friend constexpr __max_diff_type operator%(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l %= __r; return __l; } friend constexpr __max_diff_type operator<<(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l <<= __r; return __l; } friend constexpr __max_diff_type operator>>(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l >>= __r; return __l; } friend constexpr __max_diff_type operator&(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l &= __r; return __l; } friend constexpr __max_diff_type operator|(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l |= __r; return __l; } friend constexpr __max_diff_type operator^(__max_diff_type __l, const __max_diff_type& __r) noexcept { __l ^= __r; return __l; } friend constexpr bool operator==(const __max_diff_type& __l, const __max_diff_type& __r) noexcept { return __l._M_rep == __r._M_rep; } #if __cpp_lib_three_way_comparison constexpr strong_ordering operator<=>(const __max_diff_type& __r) const noexcept { const auto __lsign = _M_rep._M_msb; const auto __rsign = __r._M_rep._M_msb; if (__lsign ^ __rsign) return __lsign ? strong_ordering::less : strong_ordering::greater; else return _M_rep <=> __r._M_rep; } #else friend constexpr bool operator!=(const __max_diff_type& __l, const __max_diff_type& __r) noexcept { return !(__l == __r); } constexpr bool operator<(const __max_diff_type& __r) const noexcept { const auto __lsign = _M_rep._M_msb; const auto __rsign = __r._M_rep._M_msb; if (__lsign ^ __rsign) return __lsign; else return _M_rep < __r._M_rep; } friend constexpr bool operator>(const __max_diff_type& __l, const __max_diff_type& __r) noexcept { return __r < __l; } friend constexpr bool operator<=(const __max_diff_type& __l, const __max_diff_type& __r) noexcept { return !(__r < __l); } friend constexpr bool operator>=(const __max_diff_type& __l, const __max_diff_type& __r) noexcept { return !(__l < __r); } #endif private: __max_size_type _M_rep = 0; friend class __max_size_type; }; constexpr __max_size_type::__max_size_type(const __max_diff_type& __d) noexcept : __max_size_type(__d._M_rep) { } } // namespace __detail } // namespace ranges template<> struct numeric_limits<ranges::__detail::__max_size_type> { using _Sp = ranges::__detail::__max_size_type; static constexpr bool is_specialized = true; static constexpr bool is_signed = false; static constexpr bool is_integer = true; static constexpr bool is_exact = true; #if __SIZEOF_INT128__ static_assert(same_as<_Sp::__rep, unsigned __int128>); static constexpr int digits = 129; #else static_assert(same_as<_Sp::__rep, unsigned long long>); static constexpr int digits = __gnu_cxx::__int_traits<unsigned long long>::__digits + 1; #endif static constexpr int digits10 = static_cast<int>(digits * numbers::ln2 / numbers::ln10); static constexpr _Sp min() noexcept { return 0; } static constexpr _Sp max() noexcept { return _Sp(static_cast<_Sp::__rep>(-1), 1); } static constexpr _Sp lowest() noexcept { return min(); } }; template<> struct numeric_limits<ranges::__detail::__max_diff_type> { using _Dp = ranges::__detail::__max_diff_type; using _Sp = ranges::__detail::__max_size_type; static constexpr bool is_specialized = true; static constexpr bool is_signed = true; static constexpr bool is_integer = true; static constexpr bool is_exact = true; static constexpr int digits = numeric_limits<_Sp>::digits - 1; static constexpr int digits10 = static_cast<int>(digits * numbers::ln2 / numbers::ln10); static constexpr _Dp min() noexcept { return _Dp(_Sp(0, 1)); } static constexpr _Dp max() noexcept { return _Dp(_Sp(static_cast<_Sp::__rep>(-1), 0)); } static constexpr _Dp lowest() noexcept { return min(); } }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // C++20 && library concepts #endif // _GLIBCXX_MAX_SIZE_TYPE_H
Close