diff options
Diffstat (limited to '')
-rw-r--r-- | src/utils/dimension.hpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/utils/dimension.hpp b/src/utils/dimension.hpp index 95fc8204..85799c38 100644 --- a/src/utils/dimension.hpp +++ b/src/utils/dimension.hpp @@ -40,20 +40,23 @@ namespace usdx { } - Dimension(const Dimension& dimension) : - width(dimension.width), height(dimension.height) + /** + * Two dimensions are equal, if width and height are equal. + */ + bool operator==(const Dimension<T> &other) const { + return (width == other.width) && (height == other.height); } - Dimension<T>& operator=(const Dimension<T>& dimension) + /** + * Two dimensions are different, if either width or height are different. + */ + bool operator!=(const Dimension<T> &other) const { - width = dimension.width; - height = dimension.height; - return *this; + // they are different, if they are not equal + return !(*this == other); } - - T get_width(void) const { return width; |