os: add equality operators to 'Area'

This commit is contained in:
Norman Feske 2014-07-24 15:00:48 +02:00
parent 9d7270b174
commit 0fab869bcc
1 changed files with 10 additions and 0 deletions

View File

@ -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; }
};