Commit feb1391e authored by Pietro Saccardi's avatar Pietro Saccardi
Browse files

Added missing comparison operators.

parent e7e6696e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -38,6 +38,9 @@ namespace mem {
        inline std::size_t size() const { return _size; }

        inline explicit operator bool() const { return virt() != nullptr and size() > 0; }

        inline bool operator==(chunk const &other) const { return _virt == other._virt and _size == other._size; }
        inline bool operator!=(chunk const &other) const { return _virt != other._virt or _size != other._size; }
    };

    template <class Chunk> class mapped;
@@ -269,6 +272,9 @@ namespace mem {
        /** @brief Calls @ref reset.
         */
        inline ~mapped() { reset(); }

        inline bool operator==(mapped const &other) const { return _chunk == other._chunk; }
        inline bool operator!=(mapped const &other) const { return _chunk != other._chunk; }
    };

}