Commit feb1391e authored by Pietro Saccardi's avatar Pietro Saccardi

Added missing comparison operators.

parent e7e6696e
......@@ -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; }
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment