TargetMemoryAddressRange comparison operator

This commit is contained in:
Nav
2021-12-25 20:54:02 +00:00
parent e5e283a27b
commit 9054b17bc7

View File

@@ -26,6 +26,10 @@ namespace Bloom::Targets
return this->startAddress == rhs.startAddress && this->endAddress == rhs.endAddress; return this->startAddress == rhs.startAddress && this->endAddress == rhs.endAddress;
} }
bool operator < (const TargetMemoryAddressRange& rhs) const {
return this->startAddress < rhs.startAddress;
}
[[nodiscard]] bool intersectsWith(const TargetMemoryAddressRange& other) const { [[nodiscard]] bool intersectsWith(const TargetMemoryAddressRange& other) const {
return return
(other.startAddress <= this->startAddress && other.endAddress >= this->startAddress) (other.startAddress <= this->startAddress && other.endAddress >= this->startAddress)