StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
size.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This is the base for StormByte Suite libraries.
5 *
6 * StormByte original source is dual-licensed:
7 *
8 * 1. GNU Lesser General Public License v3.0 (or later)
9 * You may redistribute and/or modify this file under the terms of the
10 * GNU Lesser General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option)
12 * any later version.
13 *
14 * 2. Commercial license
15 * Alternatively, this file may be used under the terms of a commercial
16 * license agreement with the copyright holder
17 * (David C. Manuelda <StormByte@gmail.com>).
18 *
19 * Both licenses apply only to original StormByte source in this repository.
20 * They do not cover other StormByte modules or any third-party material
21 * shipped with this repository (including everything under thirdparty/),
22 * which remains under its own license.
23 *
24 * Neither license grants any patent rights. Any patent licenses required
25 * to use this software or third-party components must be obtained separately
26 * from the patent holders.
27 *
28 * StormByte is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU Lesser General Public License for more details.
32 *
33 * You should have received a copy of the GNU Lesser General Public License
34 * version 3 along with StormByte. If not, see
35 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
36 *
37 * SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-StormByte-Commercial
38 */
39
40#pragma once
41
45
46#include <cassert>
47#include <compare>
48#include <cstddef>
49#include <cstdint>
50#include <limits>
51#include <ostream>
52#include <span>
53#include <string>
54#include <type_traits>
55#include <utility>
56
61
66namespace StormByte {
70 namespace Safe {
71 class String;
72 class WString;
73 }
74 class ByteSize;
75
107 class STORMBYTE_PUBLIC Size final {
108 public:
112 constexpr Size() noexcept: m_value(0) {}
113
119 template<Type::Integral T>
120 constexpr Size(T value) noexcept: m_value(FromIntegral(value)) {}
121
126 constexpr Size(const Size& other) noexcept = default;
127
132 constexpr Size(Size&& other) noexcept = default;
133
137 constexpr ~Size() noexcept = default;
138
144 constexpr Size& operator=(const Size& other) noexcept = default;
145
151 constexpr Size& operator=(Size&& other) noexcept = default;
152
159 template<Type::Integral T>
160 constexpr Size& operator=(T value) noexcept {
161 m_value = FromIntegral(value);
162 return *this;
163 }
164
169 constexpr operator std::size_t() const noexcept {
170 constexpr auto max = static_cast<std::uint64_t>(std::numeric_limits<std::size_t>::max());
171 return static_cast<std::size_t>(m_value > max ? max : m_value);
172 }
173
179 template<Type::Integral T>
181 constexpr explicit operator T() const noexcept {
182 constexpr auto max = static_cast<std::uint64_t>(std::numeric_limits<T>::max());
183 return static_cast<T>(m_value > max ? max : m_value);
184 }
185
190 explicit operator Safe::String() const noexcept;
191
196 explicit operator Safe::WString() const noexcept;
197
202 STORMBYTE_FORCE_INLINE operator std::string() const {
203 return std::to_string(m_value);
204 }
205
212 friend constexpr bool operator==(Size lhs, Size rhs) noexcept {
213 return lhs.m_value == rhs.m_value;
214 }
215
220 template<Type::Integral T>
221 friend constexpr bool operator==(Size lhs, T rhs) noexcept;
222
227 template<Type::Integral T>
228 friend constexpr bool operator==(T lhs, Size rhs) noexcept;
229
236 friend STORMBYTE_FORCE_INLINE constexpr std::strong_ordering operator<=>(Size lhs, Size rhs) noexcept {
237 return lhs.m_value <=> rhs.m_value;
238 }
239
244 template<Type::Integral T>
245 friend STORMBYTE_FORCE_INLINE constexpr std::strong_ordering operator<=>(Size lhs, T rhs) noexcept {
246 return lhs <=> Size(rhs);
247 }
248
253 template<Type::Integral T>
254 friend STORMBYTE_FORCE_INLINE constexpr std::strong_ordering operator<=>(T lhs, Size rhs) noexcept {
255 return Size(lhs) <=> rhs;
256 }
257
262 constexpr Size& operator++() noexcept {
263 *this += Size(Raw{}, 1);
264 return *this;
265 }
266
271 constexpr Size operator++(int) noexcept {
272 const Size old = *this;
273 ++*this;
274 return old;
275 }
276
281 constexpr Size& operator--() noexcept {
282 *this -= Size(Raw{}, 1);
283 return *this;
284 }
285
290 constexpr Size operator--(int) noexcept {
291 const Size old = *this;
292 --*this;
293 return old;
294 }
295
302 friend constexpr Size operator+(Size lhs, Size rhs) noexcept {
303 return Size(Raw{}, Add(lhs.m_value, rhs.m_value));
304 }
305
312 friend constexpr Size operator-(Size lhs, Size rhs) noexcept {
313 return Size(Raw{}, Sub(lhs.m_value, rhs.m_value));
314 }
315
322 friend constexpr Size operator*(Size lhs, Size rhs) noexcept {
323 return Size(Raw{}, Mul(lhs.m_value, rhs.m_value));
324 }
325
332 friend constexpr Size operator/(Size lhs, Size rhs) noexcept {
333 return Size(Raw{}, Div(lhs.m_value, rhs.m_value));
334 }
335
342 friend constexpr Size operator%(Size lhs, Size rhs) noexcept {
343 return Size(Raw{}, Mod(lhs.m_value, rhs.m_value));
344 }
345
351 constexpr Size& operator+=(Size other) noexcept {
352 m_value = Add(m_value, other.m_value);
353 return *this;
354 }
355
361 constexpr Size& operator-=(Size other) noexcept {
362 m_value = Sub(m_value, other.m_value);
363 return *this;
364 }
365
371 constexpr Size& operator*=(Size other) noexcept {
372 m_value = Mul(m_value, other.m_value);
373 return *this;
374 }
375
381 constexpr Size& operator/=(Size other) noexcept {
382 m_value = Div(m_value, other.m_value);
383 return *this;
384 }
385
391 constexpr Size& operator%=(Size other) noexcept {
392 m_value = Mod(m_value, other.m_value);
393 return *this;
394 }
395
400 template<Type::Integral T>
401 friend constexpr Size operator+(Size lhs, T rhs) noexcept;
402
407 template<Type::Integral T>
408 friend constexpr Size operator+(T lhs, Size rhs) noexcept;
409
414 template<Type::Integral T>
415 friend constexpr Size operator-(Size lhs, T rhs) noexcept;
416
421 template<Type::Integral T>
422 friend constexpr Size operator-(T lhs, Size rhs) noexcept;
423
428 template<Type::Integral T>
429 friend constexpr Size operator*(Size lhs, T rhs) noexcept;
430
435 template<Type::Integral T>
436 friend constexpr Size operator*(T lhs, Size rhs) noexcept;
437
442 template<Type::Integral T>
443 friend constexpr Size operator/(Size lhs, T rhs) noexcept;
444
449 template<Type::Integral T>
450 friend constexpr Size operator/(T lhs, Size rhs) noexcept;
451
456 template<Type::Integral T>
457 friend constexpr Size operator%(Size lhs, T rhs) noexcept;
458
463 template<Type::Integral T>
464 friend constexpr Size operator%(T lhs, Size rhs) noexcept;
465
472 template<Type::Integral T>
473 constexpr Size& operator+=(T value) noexcept {
474 *this = *this + value;
475 return *this;
476 }
477
484 template<Type::Integral T>
485 constexpr Size& operator-=(T value) noexcept {
486 *this = *this - value;
487 return *this;
488 }
489
496 template<Type::Integral T>
497 constexpr Size& operator*=(T value) noexcept {
498 *this = *this * value;
499 return *this;
500 }
501
508 template<Type::Integral T>
509 constexpr Size& operator/=(T value) noexcept {
510 *this = *this / value;
511 return *this;
512 }
513
520 template<Type::Integral T>
521 constexpr Size& operator%=(T value) noexcept {
522 *this = *this % value;
523 return *this;
524 }
525
526 private:
527 std::uint64_t m_value;
528
532 struct Raw {
533 explicit constexpr Raw() noexcept = default;
534 };
535
540 explicit constexpr Size(Raw, std::uint64_t value) noexcept: m_value(value) {}
541
548 template<Type::Integral T>
549 static constexpr std::uint64_t FromIntegral(T value) noexcept {
550 if constexpr (Type::Signed<T>)
551 assert(value >= T{0});
552 return static_cast<std::uint64_t>(value);
553 }
554
561 static constexpr std::uint64_t Add(std::uint64_t lhs, std::uint64_t rhs) noexcept {
562 assert(lhs <= std::numeric_limits<std::uint64_t>::max() - rhs);
563 return lhs + rhs;
564 }
565
572 static constexpr std::uint64_t Sub(std::uint64_t lhs, std::uint64_t rhs) noexcept {
573 assert(lhs >= rhs);
574 return lhs - rhs;
575 }
576
583 static constexpr std::uint64_t Mul(std::uint64_t lhs, std::uint64_t rhs) noexcept {
584 assert(rhs == 0 || lhs <= std::numeric_limits<std::uint64_t>::max() / rhs);
585 return lhs * rhs;
586 }
587
594 static constexpr std::uint64_t Div(std::uint64_t lhs, std::uint64_t rhs) noexcept {
595 assert(rhs != 0);
596 return lhs / rhs;
597 }
598
605 static constexpr std::uint64_t Mod(std::uint64_t lhs, std::uint64_t rhs) noexcept {
606 assert(rhs != 0);
607 return lhs % rhs;
608 }
609
617 template<Type::Integral T>
618 static constexpr Size MixAdd(std::uint64_t lhs, T rhs) noexcept {
619 if constexpr (Type::Signed<T>) {
620 if (rhs < T{0}) {
621 const auto mag = static_cast<std::uint64_t>(0) - static_cast<std::uint64_t>(rhs);
622 return Size(Raw{}, Sub(lhs, mag));
623 }
624 }
625 return Size(Raw{}, Add(lhs, static_cast<std::uint64_t>(rhs)));
626 }
627
635 template<Type::Integral T>
636 static constexpr Size MixSub(std::uint64_t lhs, T rhs) noexcept {
637 if constexpr (Type::Signed<T>) {
638 if (rhs < T{0}) {
639 const auto mag = static_cast<std::uint64_t>(0) - static_cast<std::uint64_t>(rhs);
640 return Size(Raw{}, Add(lhs, mag));
641 }
642 }
643 return Size(Raw{}, Sub(lhs, static_cast<std::uint64_t>(rhs)));
644 }
645
653 template<Type::Integral T>
654 static constexpr Size MixMul(std::uint64_t lhs, T rhs) noexcept {
655 if constexpr (Type::Signed<T>)
656 assert(rhs >= T{0});
657 return Size(Raw{}, Mul(lhs, static_cast<std::uint64_t>(rhs)));
658 }
659 };
660
668 template<Type::Integral T>
669 constexpr bool operator==(Size lhs, T rhs) noexcept {
670 return lhs == Size(rhs);
671 }
672
680 template<Type::Integral T>
681 constexpr bool operator==(T lhs, Size rhs) noexcept {
682 return Size(lhs) == rhs;
683 }
684
692 template<Type::Integral T>
693 constexpr Size operator+(Size lhs, T rhs) noexcept {
694 return Size::MixAdd(lhs.m_value, rhs);
695 }
696
704 template<Type::Integral T>
705 constexpr Size operator+(T lhs, Size rhs) noexcept {
706 return Size::MixAdd(rhs.m_value, lhs);
707 }
708
716 template<Type::Integral T>
717 constexpr Size operator-(Size lhs, T rhs) noexcept {
718 return Size::MixSub(lhs.m_value, rhs);
719 }
720
728 template<Type::Integral T>
729 constexpr Size operator-(T lhs, Size rhs) noexcept {
730 return Size(lhs) - rhs;
731 }
732
740 template<Type::Integral T>
741 constexpr Size operator*(Size lhs, T rhs) noexcept {
742 return Size::MixMul(lhs.m_value, rhs);
743 }
744
752 template<Type::Integral T>
753 constexpr Size operator*(T lhs, Size rhs) noexcept {
754 return Size::MixMul(rhs.m_value, lhs);
755 }
756
764 template<Type::Integral T>
765 constexpr Size operator/(Size lhs, T rhs) noexcept {
766 return lhs / Size(rhs);
767 }
768
776 template<Type::Integral T>
777 constexpr Size operator/(T lhs, Size rhs) noexcept {
778 return Size(lhs) / rhs;
779 }
780
788 template<Type::Integral T>
789 constexpr Size operator%(Size lhs, T rhs) noexcept {
790 return lhs % Size(rhs);
791 }
792
800 template<Type::Integral T>
801 constexpr Size operator%(T lhs, Size rhs) noexcept {
802 return Size(lhs) % rhs;
803 }
804
811 inline std::ostream& operator<<(std::ostream& stream, Size size) {
812 stream << static_cast<std::string>(size);
813 return stream;
814 }
815
817 extern template STORMBYTE_PUBLIC Size& Size::operator=(char) noexcept;
818 extern template STORMBYTE_PUBLIC Size& Size::operator=(signed char) noexcept;
819 extern template STORMBYTE_PUBLIC Size& Size::operator=(unsigned char) noexcept;
820 extern template STORMBYTE_PUBLIC Size& Size::operator=(short) noexcept;
821 extern template STORMBYTE_PUBLIC Size& Size::operator=(unsigned short) noexcept;
822 extern template STORMBYTE_PUBLIC Size& Size::operator=(int) noexcept;
823 extern template STORMBYTE_PUBLIC Size& Size::operator=(unsigned int) noexcept;
824 extern template STORMBYTE_PUBLIC Size& Size::operator=(long) noexcept;
825 extern template STORMBYTE_PUBLIC Size& Size::operator=(unsigned long) noexcept;
826 extern template STORMBYTE_PUBLIC Size& Size::operator=(long long) noexcept;
827 extern template STORMBYTE_PUBLIC Size& Size::operator=(unsigned long long) noexcept;
828 extern template STORMBYTE_PUBLIC Size& Size::operator=(wchar_t) noexcept;
829 extern template STORMBYTE_PUBLIC Size& Size::operator=(char8_t) noexcept;
830 extern template STORMBYTE_PUBLIC Size& Size::operator=(char16_t) noexcept;
831 extern template STORMBYTE_PUBLIC Size& Size::operator=(char32_t) noexcept;
832
833 extern template STORMBYTE_PUBLIC Size& Size::operator+=(char) noexcept;
834 extern template STORMBYTE_PUBLIC Size& Size::operator+=(signed char) noexcept;
835 extern template STORMBYTE_PUBLIC Size& Size::operator+=(unsigned char) noexcept;
836 extern template STORMBYTE_PUBLIC Size& Size::operator+=(short) noexcept;
837 extern template STORMBYTE_PUBLIC Size& Size::operator+=(unsigned short) noexcept;
838 extern template STORMBYTE_PUBLIC Size& Size::operator+=(int) noexcept;
839 extern template STORMBYTE_PUBLIC Size& Size::operator+=(unsigned int) noexcept;
840 extern template STORMBYTE_PUBLIC Size& Size::operator+=(long) noexcept;
841 extern template STORMBYTE_PUBLIC Size& Size::operator+=(unsigned long) noexcept;
842 extern template STORMBYTE_PUBLIC Size& Size::operator+=(long long) noexcept;
843 extern template STORMBYTE_PUBLIC Size& Size::operator+=(unsigned long long) noexcept;
844 extern template STORMBYTE_PUBLIC Size& Size::operator+=(wchar_t) noexcept;
845 extern template STORMBYTE_PUBLIC Size& Size::operator+=(char8_t) noexcept;
846 extern template STORMBYTE_PUBLIC Size& Size::operator+=(char16_t) noexcept;
847 extern template STORMBYTE_PUBLIC Size& Size::operator+=(char32_t) noexcept;
848
849 extern template STORMBYTE_PUBLIC Size& Size::operator-=(char) noexcept;
850 extern template STORMBYTE_PUBLIC Size& Size::operator-=(signed char) noexcept;
851 extern template STORMBYTE_PUBLIC Size& Size::operator-=(unsigned char) noexcept;
852 extern template STORMBYTE_PUBLIC Size& Size::operator-=(short) noexcept;
853 extern template STORMBYTE_PUBLIC Size& Size::operator-=(unsigned short) noexcept;
854 extern template STORMBYTE_PUBLIC Size& Size::operator-=(int) noexcept;
855 extern template STORMBYTE_PUBLIC Size& Size::operator-=(unsigned int) noexcept;
856 extern template STORMBYTE_PUBLIC Size& Size::operator-=(long) noexcept;
857 extern template STORMBYTE_PUBLIC Size& Size::operator-=(unsigned long) noexcept;
858 extern template STORMBYTE_PUBLIC Size& Size::operator-=(long long) noexcept;
859 extern template STORMBYTE_PUBLIC Size& Size::operator-=(unsigned long long) noexcept;
860 extern template STORMBYTE_PUBLIC Size& Size::operator-=(wchar_t) noexcept;
861 extern template STORMBYTE_PUBLIC Size& Size::operator-=(char8_t) noexcept;
862 extern template STORMBYTE_PUBLIC Size& Size::operator-=(char16_t) noexcept;
863 extern template STORMBYTE_PUBLIC Size& Size::operator-=(char32_t) noexcept;
864
865 extern template STORMBYTE_PUBLIC Size& Size::operator*=(char) noexcept;
866 extern template STORMBYTE_PUBLIC Size& Size::operator*=(signed char) noexcept;
867 extern template STORMBYTE_PUBLIC Size& Size::operator*=(unsigned char) noexcept;
868 extern template STORMBYTE_PUBLIC Size& Size::operator*=(short) noexcept;
869 extern template STORMBYTE_PUBLIC Size& Size::operator*=(unsigned short) noexcept;
870 extern template STORMBYTE_PUBLIC Size& Size::operator*=(int) noexcept;
871 extern template STORMBYTE_PUBLIC Size& Size::operator*=(unsigned int) noexcept;
872 extern template STORMBYTE_PUBLIC Size& Size::operator*=(long) noexcept;
873 extern template STORMBYTE_PUBLIC Size& Size::operator*=(unsigned long) noexcept;
874 extern template STORMBYTE_PUBLIC Size& Size::operator*=(long long) noexcept;
875 extern template STORMBYTE_PUBLIC Size& Size::operator*=(unsigned long long) noexcept;
876 extern template STORMBYTE_PUBLIC Size& Size::operator*=(wchar_t) noexcept;
877 extern template STORMBYTE_PUBLIC Size& Size::operator*=(char8_t) noexcept;
878 extern template STORMBYTE_PUBLIC Size& Size::operator*=(char16_t) noexcept;
879 extern template STORMBYTE_PUBLIC Size& Size::operator*=(char32_t) noexcept;
880
881 extern template STORMBYTE_PUBLIC Size& Size::operator/=(char) noexcept;
882 extern template STORMBYTE_PUBLIC Size& Size::operator/=(signed char) noexcept;
883 extern template STORMBYTE_PUBLIC Size& Size::operator/=(unsigned char) noexcept;
884 extern template STORMBYTE_PUBLIC Size& Size::operator/=(short) noexcept;
885 extern template STORMBYTE_PUBLIC Size& Size::operator/=(unsigned short) noexcept;
886 extern template STORMBYTE_PUBLIC Size& Size::operator/=(int) noexcept;
887 extern template STORMBYTE_PUBLIC Size& Size::operator/=(unsigned int) noexcept;
888 extern template STORMBYTE_PUBLIC Size& Size::operator/=(long) noexcept;
889 extern template STORMBYTE_PUBLIC Size& Size::operator/=(unsigned long) noexcept;
890 extern template STORMBYTE_PUBLIC Size& Size::operator/=(long long) noexcept;
891 extern template STORMBYTE_PUBLIC Size& Size::operator/=(unsigned long long) noexcept;
892 extern template STORMBYTE_PUBLIC Size& Size::operator/=(wchar_t) noexcept;
893 extern template STORMBYTE_PUBLIC Size& Size::operator/=(char8_t) noexcept;
894 extern template STORMBYTE_PUBLIC Size& Size::operator/=(char16_t) noexcept;
895 extern template STORMBYTE_PUBLIC Size& Size::operator/=(char32_t) noexcept;
896
897 extern template STORMBYTE_PUBLIC Size& Size::operator%=(char) noexcept;
898 extern template STORMBYTE_PUBLIC Size& Size::operator%=(signed char) noexcept;
899 extern template STORMBYTE_PUBLIC Size& Size::operator%=(unsigned char) noexcept;
900 extern template STORMBYTE_PUBLIC Size& Size::operator%=(short) noexcept;
901 extern template STORMBYTE_PUBLIC Size& Size::operator%=(unsigned short) noexcept;
902 extern template STORMBYTE_PUBLIC Size& Size::operator%=(int) noexcept;
903 extern template STORMBYTE_PUBLIC Size& Size::operator%=(unsigned int) noexcept;
904 extern template STORMBYTE_PUBLIC Size& Size::operator%=(long) noexcept;
905 extern template STORMBYTE_PUBLIC Size& Size::operator%=(unsigned long) noexcept;
906 extern template STORMBYTE_PUBLIC Size& Size::operator%=(long long) noexcept;
907 extern template STORMBYTE_PUBLIC Size& Size::operator%=(unsigned long long) noexcept;
908 extern template STORMBYTE_PUBLIC Size& Size::operator%=(wchar_t) noexcept;
909 extern template STORMBYTE_PUBLIC Size& Size::operator%=(char8_t) noexcept;
910 extern template STORMBYTE_PUBLIC Size& Size::operator%=(char16_t) noexcept;
911 extern template STORMBYTE_PUBLIC Size& Size::operator%=(char32_t) noexcept;
912
913 extern template STORMBYTE_PUBLIC Size::operator char() const noexcept;
914 extern template STORMBYTE_PUBLIC Size::operator signed char() const noexcept;
915 extern template STORMBYTE_PUBLIC Size::operator unsigned char() const noexcept;
916 extern template STORMBYTE_PUBLIC Size::operator short() const noexcept;
917 extern template STORMBYTE_PUBLIC Size::operator unsigned short() const noexcept;
918 extern template STORMBYTE_PUBLIC Size::operator int() const noexcept;
919 extern template STORMBYTE_PUBLIC Size::operator unsigned int() const noexcept;
920 extern template STORMBYTE_PUBLIC Size::operator long() const noexcept;
921 extern template STORMBYTE_PUBLIC Size::operator long long() const noexcept;
922 extern template STORMBYTE_PUBLIC Size::operator wchar_t() const noexcept;
923 extern template STORMBYTE_PUBLIC Size::operator char8_t() const noexcept;
924 extern template STORMBYTE_PUBLIC Size::operator char16_t() const noexcept;
925 extern template STORMBYTE_PUBLIC Size::operator char32_t() const noexcept;
926
927 extern template STORMBYTE_PUBLIC bool operator==(Size, char) noexcept;
928 extern template STORMBYTE_PUBLIC bool operator==(Size, signed char) noexcept;
929 extern template STORMBYTE_PUBLIC bool operator==(Size, unsigned char) noexcept;
930 extern template STORMBYTE_PUBLIC bool operator==(Size, short) noexcept;
931 extern template STORMBYTE_PUBLIC bool operator==(Size, unsigned short) noexcept;
932 extern template STORMBYTE_PUBLIC bool operator==(Size, int) noexcept;
933 extern template STORMBYTE_PUBLIC bool operator==(Size, unsigned int) noexcept;
934 extern template STORMBYTE_PUBLIC bool operator==(Size, long) noexcept;
935 extern template STORMBYTE_PUBLIC bool operator==(Size, unsigned long) noexcept;
936 extern template STORMBYTE_PUBLIC bool operator==(Size, long long) noexcept;
937 extern template STORMBYTE_PUBLIC bool operator==(Size, unsigned long long) noexcept;
938 extern template STORMBYTE_PUBLIC bool operator==(Size, wchar_t) noexcept;
939 extern template STORMBYTE_PUBLIC bool operator==(Size, char8_t) noexcept;
940 extern template STORMBYTE_PUBLIC bool operator==(Size, char16_t) noexcept;
941 extern template STORMBYTE_PUBLIC bool operator==(Size, char32_t) noexcept;
942
943 extern template STORMBYTE_PUBLIC bool operator==(char, Size) noexcept;
944 extern template STORMBYTE_PUBLIC bool operator==(signed char, Size) noexcept;
945 extern template STORMBYTE_PUBLIC bool operator==(unsigned char, Size) noexcept;
946 extern template STORMBYTE_PUBLIC bool operator==(short, Size) noexcept;
947 extern template STORMBYTE_PUBLIC bool operator==(unsigned short, Size) noexcept;
948 extern template STORMBYTE_PUBLIC bool operator==(int, Size) noexcept;
949 extern template STORMBYTE_PUBLIC bool operator==(unsigned int, Size) noexcept;
950 extern template STORMBYTE_PUBLIC bool operator==(long, Size) noexcept;
951 extern template STORMBYTE_PUBLIC bool operator==(unsigned long, Size) noexcept;
952 extern template STORMBYTE_PUBLIC bool operator==(long long, Size) noexcept;
953 extern template STORMBYTE_PUBLIC bool operator==(unsigned long long, Size) noexcept;
954 extern template STORMBYTE_PUBLIC bool operator==(wchar_t, Size) noexcept;
955 extern template STORMBYTE_PUBLIC bool operator==(char8_t, Size) noexcept;
956 extern template STORMBYTE_PUBLIC bool operator==(char16_t, Size) noexcept;
957 extern template STORMBYTE_PUBLIC bool operator==(char32_t, Size) noexcept;
958
959 extern template STORMBYTE_PUBLIC Size operator+(Size, char) noexcept;
960 extern template STORMBYTE_PUBLIC Size operator+(Size, signed char) noexcept;
961 extern template STORMBYTE_PUBLIC Size operator+(Size, unsigned char) noexcept;
962 extern template STORMBYTE_PUBLIC Size operator+(Size, short) noexcept;
963 extern template STORMBYTE_PUBLIC Size operator+(Size, unsigned short) noexcept;
964 extern template STORMBYTE_PUBLIC Size operator+(Size, int) noexcept;
965 extern template STORMBYTE_PUBLIC Size operator+(Size, unsigned int) noexcept;
966 extern template STORMBYTE_PUBLIC Size operator+(Size, long) noexcept;
967 extern template STORMBYTE_PUBLIC Size operator+(Size, unsigned long) noexcept;
968 extern template STORMBYTE_PUBLIC Size operator+(Size, long long) noexcept;
969 extern template STORMBYTE_PUBLIC Size operator+(Size, unsigned long long) noexcept;
970 extern template STORMBYTE_PUBLIC Size operator+(Size, wchar_t) noexcept;
971 extern template STORMBYTE_PUBLIC Size operator+(Size, char8_t) noexcept;
972 extern template STORMBYTE_PUBLIC Size operator+(Size, char16_t) noexcept;
973 extern template STORMBYTE_PUBLIC Size operator+(Size, char32_t) noexcept;
974
975 extern template STORMBYTE_PUBLIC Size operator+(char, Size) noexcept;
976 extern template STORMBYTE_PUBLIC Size operator+(signed char, Size) noexcept;
977 extern template STORMBYTE_PUBLIC Size operator+(unsigned char, Size) noexcept;
978 extern template STORMBYTE_PUBLIC Size operator+(short, Size) noexcept;
979 extern template STORMBYTE_PUBLIC Size operator+(unsigned short, Size) noexcept;
980 extern template STORMBYTE_PUBLIC Size operator+(int, Size) noexcept;
981 extern template STORMBYTE_PUBLIC Size operator+(unsigned int, Size) noexcept;
982 extern template STORMBYTE_PUBLIC Size operator+(long, Size) noexcept;
983 extern template STORMBYTE_PUBLIC Size operator+(unsigned long, Size) noexcept;
984 extern template STORMBYTE_PUBLIC Size operator+(long long, Size) noexcept;
985 extern template STORMBYTE_PUBLIC Size operator+(unsigned long long, Size) noexcept;
986 extern template STORMBYTE_PUBLIC Size operator+(wchar_t, Size) noexcept;
987 extern template STORMBYTE_PUBLIC Size operator+(char8_t, Size) noexcept;
988 extern template STORMBYTE_PUBLIC Size operator+(char16_t, Size) noexcept;
989 extern template STORMBYTE_PUBLIC Size operator+(char32_t, Size) noexcept;
990
991 extern template STORMBYTE_PUBLIC Size operator-(Size, char) noexcept;
992 extern template STORMBYTE_PUBLIC Size operator-(Size, signed char) noexcept;
993 extern template STORMBYTE_PUBLIC Size operator-(Size, unsigned char) noexcept;
994 extern template STORMBYTE_PUBLIC Size operator-(Size, short) noexcept;
995 extern template STORMBYTE_PUBLIC Size operator-(Size, unsigned short) noexcept;
996 extern template STORMBYTE_PUBLIC Size operator-(Size, int) noexcept;
997 extern template STORMBYTE_PUBLIC Size operator-(Size, unsigned int) noexcept;
998 extern template STORMBYTE_PUBLIC Size operator-(Size, long) noexcept;
999 extern template STORMBYTE_PUBLIC Size operator-(Size, unsigned long) noexcept;
1000 extern template STORMBYTE_PUBLIC Size operator-(Size, long long) noexcept;
1001 extern template STORMBYTE_PUBLIC Size operator-(Size, unsigned long long) noexcept;
1002 extern template STORMBYTE_PUBLIC Size operator-(Size, wchar_t) noexcept;
1003 extern template STORMBYTE_PUBLIC Size operator-(Size, char8_t) noexcept;
1004 extern template STORMBYTE_PUBLIC Size operator-(Size, char16_t) noexcept;
1005 extern template STORMBYTE_PUBLIC Size operator-(Size, char32_t) noexcept;
1006
1007 extern template STORMBYTE_PUBLIC Size operator-(char, Size) noexcept;
1008 extern template STORMBYTE_PUBLIC Size operator-(signed char, Size) noexcept;
1009 extern template STORMBYTE_PUBLIC Size operator-(unsigned char, Size) noexcept;
1010 extern template STORMBYTE_PUBLIC Size operator-(short, Size) noexcept;
1011 extern template STORMBYTE_PUBLIC Size operator-(unsigned short, Size) noexcept;
1012 extern template STORMBYTE_PUBLIC Size operator-(int, Size) noexcept;
1013 extern template STORMBYTE_PUBLIC Size operator-(unsigned int, Size) noexcept;
1014 extern template STORMBYTE_PUBLIC Size operator-(long, Size) noexcept;
1015 extern template STORMBYTE_PUBLIC Size operator-(unsigned long, Size) noexcept;
1016 extern template STORMBYTE_PUBLIC Size operator-(long long, Size) noexcept;
1017 extern template STORMBYTE_PUBLIC Size operator-(unsigned long long, Size) noexcept;
1018 extern template STORMBYTE_PUBLIC Size operator-(wchar_t, Size) noexcept;
1019 extern template STORMBYTE_PUBLIC Size operator-(char8_t, Size) noexcept;
1020 extern template STORMBYTE_PUBLIC Size operator-(char16_t, Size) noexcept;
1021 extern template STORMBYTE_PUBLIC Size operator-(char32_t, Size) noexcept;
1022
1023 extern template STORMBYTE_PUBLIC Size operator*(Size, char) noexcept;
1024 extern template STORMBYTE_PUBLIC Size operator*(Size, signed char) noexcept;
1025 extern template STORMBYTE_PUBLIC Size operator*(Size, unsigned char) noexcept;
1026 extern template STORMBYTE_PUBLIC Size operator*(Size, short) noexcept;
1027 extern template STORMBYTE_PUBLIC Size operator*(Size, unsigned short) noexcept;
1028 extern template STORMBYTE_PUBLIC Size operator*(Size, int) noexcept;
1029 extern template STORMBYTE_PUBLIC Size operator*(Size, unsigned int) noexcept;
1030 extern template STORMBYTE_PUBLIC Size operator*(Size, long) noexcept;
1031 extern template STORMBYTE_PUBLIC Size operator*(Size, unsigned long) noexcept;
1032 extern template STORMBYTE_PUBLIC Size operator*(Size, long long) noexcept;
1033 extern template STORMBYTE_PUBLIC Size operator*(Size, unsigned long long) noexcept;
1034 extern template STORMBYTE_PUBLIC Size operator*(Size, wchar_t) noexcept;
1035 extern template STORMBYTE_PUBLIC Size operator*(Size, char8_t) noexcept;
1036 extern template STORMBYTE_PUBLIC Size operator*(Size, char16_t) noexcept;
1037 extern template STORMBYTE_PUBLIC Size operator*(Size, char32_t) noexcept;
1038
1039 extern template STORMBYTE_PUBLIC Size operator*(char, Size) noexcept;
1040 extern template STORMBYTE_PUBLIC Size operator*(signed char, Size) noexcept;
1041 extern template STORMBYTE_PUBLIC Size operator*(unsigned char, Size) noexcept;
1042 extern template STORMBYTE_PUBLIC Size operator*(short, Size) noexcept;
1043 extern template STORMBYTE_PUBLIC Size operator*(unsigned short, Size) noexcept;
1044 extern template STORMBYTE_PUBLIC Size operator*(int, Size) noexcept;
1045 extern template STORMBYTE_PUBLIC Size operator*(unsigned int, Size) noexcept;
1046 extern template STORMBYTE_PUBLIC Size operator*(long, Size) noexcept;
1047 extern template STORMBYTE_PUBLIC Size operator*(unsigned long, Size) noexcept;
1048 extern template STORMBYTE_PUBLIC Size operator*(long long, Size) noexcept;
1049 extern template STORMBYTE_PUBLIC Size operator*(unsigned long long, Size) noexcept;
1050 extern template STORMBYTE_PUBLIC Size operator*(wchar_t, Size) noexcept;
1051 extern template STORMBYTE_PUBLIC Size operator*(char8_t, Size) noexcept;
1052 extern template STORMBYTE_PUBLIC Size operator*(char16_t, Size) noexcept;
1053 extern template STORMBYTE_PUBLIC Size operator*(char32_t, Size) noexcept;
1054
1055 extern template STORMBYTE_PUBLIC Size operator/(Size, char) noexcept;
1056 extern template STORMBYTE_PUBLIC Size operator/(Size, signed char) noexcept;
1057 extern template STORMBYTE_PUBLIC Size operator/(Size, unsigned char) noexcept;
1058 extern template STORMBYTE_PUBLIC Size operator/(Size, short) noexcept;
1059 extern template STORMBYTE_PUBLIC Size operator/(Size, unsigned short) noexcept;
1060 extern template STORMBYTE_PUBLIC Size operator/(Size, int) noexcept;
1061 extern template STORMBYTE_PUBLIC Size operator/(Size, unsigned int) noexcept;
1062 extern template STORMBYTE_PUBLIC Size operator/(Size, long) noexcept;
1063 extern template STORMBYTE_PUBLIC Size operator/(Size, unsigned long) noexcept;
1064 extern template STORMBYTE_PUBLIC Size operator/(Size, long long) noexcept;
1065 extern template STORMBYTE_PUBLIC Size operator/(Size, unsigned long long) noexcept;
1066 extern template STORMBYTE_PUBLIC Size operator/(Size, wchar_t) noexcept;
1067 extern template STORMBYTE_PUBLIC Size operator/(Size, char8_t) noexcept;
1068 extern template STORMBYTE_PUBLIC Size operator/(Size, char16_t) noexcept;
1069 extern template STORMBYTE_PUBLIC Size operator/(Size, char32_t) noexcept;
1070
1071 extern template STORMBYTE_PUBLIC Size operator/(char, Size) noexcept;
1072 extern template STORMBYTE_PUBLIC Size operator/(signed char, Size) noexcept;
1073 extern template STORMBYTE_PUBLIC Size operator/(unsigned char, Size) noexcept;
1074 extern template STORMBYTE_PUBLIC Size operator/(short, Size) noexcept;
1075 extern template STORMBYTE_PUBLIC Size operator/(unsigned short, Size) noexcept;
1076 extern template STORMBYTE_PUBLIC Size operator/(int, Size) noexcept;
1077 extern template STORMBYTE_PUBLIC Size operator/(unsigned int, Size) noexcept;
1078 extern template STORMBYTE_PUBLIC Size operator/(long, Size) noexcept;
1079 extern template STORMBYTE_PUBLIC Size operator/(unsigned long, Size) noexcept;
1080 extern template STORMBYTE_PUBLIC Size operator/(long long, Size) noexcept;
1081 extern template STORMBYTE_PUBLIC Size operator/(unsigned long long, Size) noexcept;
1082 extern template STORMBYTE_PUBLIC Size operator/(wchar_t, Size) noexcept;
1083 extern template STORMBYTE_PUBLIC Size operator/(char8_t, Size) noexcept;
1084 extern template STORMBYTE_PUBLIC Size operator/(char16_t, Size) noexcept;
1085 extern template STORMBYTE_PUBLIC Size operator/(char32_t, Size) noexcept;
1086
1087 extern template STORMBYTE_PUBLIC Size operator%(Size, char) noexcept;
1088 extern template STORMBYTE_PUBLIC Size operator%(Size, signed char) noexcept;
1089 extern template STORMBYTE_PUBLIC Size operator%(Size, unsigned char) noexcept;
1090 extern template STORMBYTE_PUBLIC Size operator%(Size, short) noexcept;
1091 extern template STORMBYTE_PUBLIC Size operator%(Size, unsigned short) noexcept;
1092 extern template STORMBYTE_PUBLIC Size operator%(Size, int) noexcept;
1093 extern template STORMBYTE_PUBLIC Size operator%(Size, unsigned int) noexcept;
1094 extern template STORMBYTE_PUBLIC Size operator%(Size, long) noexcept;
1095 extern template STORMBYTE_PUBLIC Size operator%(Size, unsigned long) noexcept;
1096 extern template STORMBYTE_PUBLIC Size operator%(Size, long long) noexcept;
1097 extern template STORMBYTE_PUBLIC Size operator%(Size, unsigned long long) noexcept;
1098 extern template STORMBYTE_PUBLIC Size operator%(Size, wchar_t) noexcept;
1099 extern template STORMBYTE_PUBLIC Size operator%(Size, char8_t) noexcept;
1100 extern template STORMBYTE_PUBLIC Size operator%(Size, char16_t) noexcept;
1101 extern template STORMBYTE_PUBLIC Size operator%(Size, char32_t) noexcept;
1102
1103 extern template STORMBYTE_PUBLIC Size operator%(char, Size) noexcept;
1104 extern template STORMBYTE_PUBLIC Size operator%(signed char, Size) noexcept;
1105 extern template STORMBYTE_PUBLIC Size operator%(unsigned char, Size) noexcept;
1106 extern template STORMBYTE_PUBLIC Size operator%(short, Size) noexcept;
1107 extern template STORMBYTE_PUBLIC Size operator%(unsigned short, Size) noexcept;
1108 extern template STORMBYTE_PUBLIC Size operator%(int, Size) noexcept;
1109 extern template STORMBYTE_PUBLIC Size operator%(unsigned int, Size) noexcept;
1110 extern template STORMBYTE_PUBLIC Size operator%(long, Size) noexcept;
1111 extern template STORMBYTE_PUBLIC Size operator%(unsigned long, Size) noexcept;
1112 extern template STORMBYTE_PUBLIC Size operator%(long long, Size) noexcept;
1113 extern template STORMBYTE_PUBLIC Size operator%(unsigned long long, Size) noexcept;
1114 extern template STORMBYTE_PUBLIC Size operator%(wchar_t, Size) noexcept;
1115 extern template STORMBYTE_PUBLIC Size operator%(char8_t, Size) noexcept;
1116 extern template STORMBYTE_PUBLIC Size operator%(char16_t, Size) noexcept;
1117 extern template STORMBYTE_PUBLIC Size operator%(char32_t, Size) noexcept;
1119}
1120
1121template<>
1128 STORMBYTE_FORCE_INLINE std::size_t operator()(const StormByte::Size& value) const noexcept {
1129 const auto widened = static_cast<std::uint64_t>(static_cast<std::size_t>(value));
1130 return HashBytes(std::as_bytes(std::span<const std::uint64_t>(&widened, 1)));
1131 }
1132};
1133
1139template<>
1140class std::numeric_limits<StormByte::Size> {
1141 public:
1142 static constexpr bool is_specialized = true;
1143 static constexpr bool is_signed = false;
1144 static constexpr bool is_integer = true;
1145 static constexpr bool is_exact = true;
1146 static constexpr bool has_infinity = false;
1147 static constexpr bool has_quiet_NaN = false;
1148 static constexpr bool has_signaling_NaN = false;
1149 static constexpr std::float_denorm_style has_denorm = std::denorm_absent;
1150 static constexpr bool has_denorm_loss = false;
1151 static constexpr std::float_round_style round_style = std::round_toward_zero;
1152 static constexpr bool is_iec559 = false;
1153 static constexpr bool is_bounded = true;
1154 static constexpr bool is_modulo = false;
1155 static constexpr int digits = 64;
1156 static constexpr int digits10 = 19;
1157 static constexpr int max_digits10 = 0;
1158 static constexpr int radix = 2;
1159 static constexpr int min_exponent = 0;
1160 static constexpr int min_exponent10 = 0;
1161 static constexpr int max_exponent = 0;
1162 static constexpr int max_exponent10 = 0;
1163 static constexpr bool traps = false;
1164 static constexpr bool tinyness_before = false;
1165
1167 static constexpr StormByte::Size min() noexcept { return StormByte::Size{0}; }
1169 static constexpr StormByte::Size lowest() noexcept { return StormByte::Size{0}; }
1171 static constexpr StormByte::Size max() noexcept { return StormByte::Size{std::numeric_limits<std::uint64_t>::max()}; }
1173 static constexpr StormByte::Size epsilon() noexcept { return StormByte::Size{0}; }
1175 static constexpr StormByte::Size round_error() noexcept { return StormByte::Size{0}; }
1177 static constexpr StormByte::Size infinity() noexcept { return StormByte::Size{0}; }
1179 static constexpr StormByte::Size quiet_NaN() noexcept { return StormByte::Size{0}; }
1181 static constexpr StormByte::Size signaling_NaN() noexcept { return StormByte::Size{0}; }
1183 static constexpr StormByte::Size denorm_min() noexcept { return StormByte::Size{0}; }
1184};
1185
1186template<>
1187struct std::hash<StormByte::Size> {
1193 std::size_t operator()(const StormByte::Size& value) const noexcept {
1195 }
1196};
Count of octets (uint64_t storage).
Definition byte_size.hxx:105
Owned UTF-8 text.
Definition string.hxx:113
Wide counterpart of String.
Definition wstring.hxx:104
Count of abstract units (uint64_t storage).
Definition size.hxx:107
constexpr Size & operator/=(Size other) noexcept
Divide by other.
Definition size.hxx:381
friend constexpr Size operator-(Size lhs, Size rhs) noexcept
Difference.
Definition size.hxx:312
friend constexpr Size operator*(Size lhs, Size rhs) noexcept
Product.
Definition size.hxx:322
constexpr Size operator--(int) noexcept
Postfix decrement.
Definition size.hxx:290
constexpr Size & operator-=(T value) noexcept
Subtract an integer.
Definition size.hxx:485
operator Safe::WString() const noexcept
Decimal wide text owned by Base.
constexpr Size & operator%=(T value) noexcept
Remainder with an integer.
Definition size.hxx:521
constexpr Size & operator/=(T value) noexcept
Divide by an integer.
Definition size.hxx:509
constexpr Size & operator+=(T value) noexcept
Add an integer.
Definition size.hxx:473
constexpr Size operator++(int) noexcept
Postfix increment.
Definition size.hxx:271
constexpr Size(T value) noexcept
From an integer count.
Definition size.hxx:120
constexpr Size & operator*=(T value) noexcept
Multiply by an integer.
Definition size.hxx:497
friend STORMBYTE_FORCE_INLINE constexpr std::strong_ordering operator<=>(Size lhs, Size rhs) noexcept
Numeric order.
Definition size.hxx:236
constexpr Size(Size &&other) noexcept=default
Move constructor.
constexpr Size & operator++() noexcept
Prefix increment.
Definition size.hxx:262
friend constexpr Size operator/(Size lhs, Size rhs) noexcept
Quotient.
Definition size.hxx:332
constexpr ~Size() noexcept=default
Destructor.
constexpr Size & operator+=(Size other) noexcept
Add other.
Definition size.hxx:351
constexpr Size & operator%=(Size other) noexcept
Remainder with other.
Definition size.hxx:391
constexpr Size(const Size &other) noexcept=default
Copy constructor.
constexpr Size() noexcept
Zero.
Definition size.hxx:112
constexpr Size & operator--() noexcept
Prefix decrement.
Definition size.hxx:281
constexpr Size & operator-=(Size other) noexcept
Subtract other.
Definition size.hxx:361
friend STORMBYTE_FORCE_INLINE constexpr std::strong_ordering operator<=>(T lhs, Size rhs) noexcept
Mixed order.
Definition size.hxx:254
friend constexpr Size operator%(Size lhs, Size rhs) noexcept
Remainder.
Definition size.hxx:342
friend constexpr bool operator==(Size lhs, Size rhs) noexcept
Numeric equality.
Definition size.hxx:212
friend STORMBYTE_FORCE_INLINE constexpr std::strong_ordering operator<=>(Size lhs, T rhs) noexcept
Mixed order.
Definition size.hxx:245
constexpr Size & operator*=(Size other) noexcept
Multiply by other.
Definition size.hxx:371
friend constexpr Size operator+(Size lhs, Size rhs) noexcept
Sum.
Definition size.hxx:302
static constexpr int max_digits10
Definition size.hxx:1157
static constexpr int min_exponent10
Definition size.hxx:1160
static constexpr bool is_specialized
Definition size.hxx:1142
static constexpr int max_exponent
Definition size.hxx:1161
static constexpr bool traps
Definition size.hxx:1163
static constexpr int max_exponent10
Definition size.hxx:1162
static constexpr StormByte::Size epsilon() noexcept
Not meaningful for an integer.
Definition size.hxx:1173
static constexpr StormByte::Size round_error() noexcept
Not meaningful for an integer.
Definition size.hxx:1175
static constexpr std::float_denorm_style has_denorm
Definition size.hxx:1149
static constexpr StormByte::Size min() noexcept
Zero.
Definition size.hxx:1167
static constexpr bool is_iec559
Definition size.hxx:1152
static constexpr StormByte::Size denorm_min() noexcept
Not meaningful.
Definition size.hxx:1183
static constexpr int radix
Definition size.hxx:1158
static constexpr bool has_quiet_NaN
Definition size.hxx:1147
static constexpr StormByte::Size quiet_NaN() noexcept
Not meaningful.
Definition size.hxx:1179
static constexpr bool has_infinity
Definition size.hxx:1146
static constexpr bool is_bounded
Definition size.hxx:1153
static constexpr int digits10
Definition size.hxx:1156
static constexpr StormByte::Size signaling_NaN() noexcept
Not meaningful.
Definition size.hxx:1181
static constexpr bool is_integer
Definition size.hxx:1144
static constexpr bool is_signed
Definition size.hxx:1143
static constexpr int digits
Definition size.hxx:1155
static constexpr StormByte::Size infinity() noexcept
Not meaningful.
Definition size.hxx:1177
static constexpr int min_exponent
Definition size.hxx:1159
static constexpr bool has_denorm_loss
Definition size.hxx:1150
static constexpr bool is_modulo
Definition size.hxx:1154
static constexpr bool is_exact
Definition size.hxx:1145
static constexpr std::float_round_style round_style
Definition size.hxx:1151
static constexpr StormByte::Size max() noexcept
2^64 - 1.
Definition size.hxx:1171
static constexpr StormByte::Size lowest() noexcept
Zero.
Definition size.hxx:1169
static constexpr bool has_signaling_NaN
Definition size.hxx:1148
static constexpr bool tinyness_before
Definition size.hxx:1164
Same type after stripping cv and references from both sides.
Definition relations.hxx:139
Owned values that cross a DLL without the caller's CRT.
STORMBYTE_FORCE_INLINE std::size_t HashBytes(std::span< const std::byte > bytes) noexcept
Mix a byte range with FNV-1a.
Definition hash.hxx:66
Root namespace of the StormByte suite.
constexpr bool operator==(ByteSize lhs, T rhs) noexcept
Mixed equality.
Definition byte_size.hxx:748
constexpr ByteSize operator%(ByteSize lhs, T rhs) noexcept
Mixed remainder.
Definition byte_size.hxx:856
std::ostream & operator<<(std::ostream &stream, ByteSize size)
Writes the IEC human-readable length.
Definition byte_size.hxx:866
constexpr ByteSize operator+(ByteSize lhs, T rhs) noexcept
Mixed sum.
Definition byte_size.hxx:772
constexpr ByteSize operator*(ByteSize lhs, T rhs) noexcept
Mixed product.
Definition byte_size.hxx:820
constexpr ByteSize operator/(ByteSize lhs, T rhs) noexcept
Mixed quotient.
Definition byte_size.hxx:844
constexpr ByteSize operator-(ByteSize lhs, T rhs) noexcept
Mixed difference.
Definition byte_size.hxx:796
Octet count. Defined in byte_size.hxx. Forwarded so Type::Numeral can name it.
STL namespace.
#define STORMBYTE_FORCE_INLINE
Definition platform.h:134
STORMBYTE_FORCE_INLINE std::size_t operator()(const StormByte::Size &value) const noexcept
Hash value.
Definition size.hxx:1128
Cross-module hash.
Definition hash.hxx:95
std::size_t operator()(const StormByte::Size &value) const noexcept
Hash value.
Definition size.hxx:1193
#define STORMBYTE_PUBLIC
Definition visibility.h:52