From 0fab869bccd327a94e9ea0c518011f8a145ec716 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 24 Jul 2014 15:00:48 +0200 Subject: [PATCH] os: add equality operators to 'Area' --- repos/os/include/util/geometry.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/repos/os/include/util/geometry.h b/repos/os/include/util/geometry.h index 5fd266874d..88caead4c6 100644 --- a/repos/os/include/util/geometry.h +++ b/repos/os/include/util/geometry.h @@ -85,6 +85,16 @@ class Genode::Area bool valid() const { return _w > 0 && _h > 0; } size_t count() const { return _w*_h; } + + /** + * Operator for testing non-equality of two areas + */ + bool operator != (Area const &a) const { return a.w() != _w || a.h() != _h; } + + /** + * Operator for testing equality of two areas + */ + bool operator == (Area const &a) const { return a.w() == _w && a.h() == _h; } };