From 47171f593c14d1d83023512c3b36d31fcf972c01 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 19 Oct 2020 19:42:34 -0500 Subject: [PATCH] [nostalgia/common] Add != operator to Point --- src/nostalgia/common/point.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/nostalgia/common/point.hpp b/src/nostalgia/common/point.hpp index 7d7deece..bed49d15 100644 --- a/src/nostalgia/common/point.hpp +++ b/src/nostalgia/common/point.hpp @@ -57,7 +57,9 @@ class Point { constexpr Point operator/=(int i); - constexpr bool operator==(const Point&); + constexpr bool operator==(const Point&) const; + + constexpr bool operator!=(const Point&) const; }; @@ -169,11 +171,16 @@ constexpr Point Point::operator/=(int i) { return *this; } -constexpr bool Point::operator==(const Point &p) { +constexpr bool Point::operator==(const Point &p) const { return x == p.x && y == p.y; } +constexpr bool Point::operator!=(const Point &p) const { + return x != p.x || y != p.y; +} + + template ox::Error model(T *io, Point *obj) { auto err = OxError(0);