diff --git a/openVulkanoCpp/Math/ByteSize.hpp b/openVulkanoCpp/Math/ByteSize.hpp index 6cda7cc..9ba1e59 100644 --- a/openVulkanoCpp/Math/ByteSize.hpp +++ b/openVulkanoCpp/Math/ByteSize.hpp @@ -132,6 +132,17 @@ namespace OpenVulkano constexpr operator uint64_t() const { return bytes; } operator std::string() const { return Format(); } + + ByteSize operator +(const ByteSize other) const { return bytes + other.bytes; } + ByteSize operator -(const ByteSize other) const { return bytes + other.bytes; } + ByteSize operator +(const size_t other) const { return bytes + other; } + ByteSize operator -(const size_t other) const { return bytes + other; } + ByteSize& operator =(const size_t other) { bytes = other; return *this; } + ByteSize& operator =(const ByteSize other) { bytes = other.bytes; return *this; } + ByteSize& operator +=(const size_t other) { bytes += other; return *this; } + ByteSize& operator +=(const ByteSize other) { bytes += other.bytes; return *this; } + ByteSize& operator -=(const size_t other) { bytes -= other; return *this; } + ByteSize& operator -=(const ByteSize other) { bytes -= other.bytes; return *this; } }; inline constexpr ByteSize operator"" _kiB(long double num) { return { num, ByteSizeUnit::kiB }; } @@ -174,4 +185,4 @@ template<> struct fmt::formatter return fmt::format_to(ctx.out(), "{}", bs.Format()); } }; -#endif \ No newline at end of file +#endif