Просмотр исходного кода

Kernel: Add some comparison operators to PhysicalAddress

Conrad Pankoff 6 лет назад
Родитель
Сommit
1a77dfed23
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      Kernel/PhysicalAddress.h

+ 5 - 0
Kernel/PhysicalAddress.h

@@ -21,6 +21,11 @@ public:
     dword page_base() const { return m_address & 0xfffff000; }
 
     bool operator==(const PhysicalAddress& other) const { return m_address == other.m_address; }
+    bool operator!=(const PhysicalAddress& other) const { return m_address != other.m_address; }
+    bool operator>(const PhysicalAddress& other) const { return m_address > other.m_address; }
+    bool operator>=(const PhysicalAddress& other) const { return m_address >= other.m_address; }
+    bool operator<(const PhysicalAddress& other) const { return m_address < other.m_address; }
+    bool operator<=(const PhysicalAddress& other) const { return m_address <= other.m_address; }
 
 private:
     dword m_address { 0 };