diff options
author | Neil <nyamatongwe@gmail.com> | 2019-03-18 19:22:38 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-03-18 19:22:38 +1100 |
commit | 983d5165878df0190964a8f903c24055f9144612 (patch) | |
tree | 8f88b9eecbb4ee07725af5bafed081c68a453016 /include/Platform.h | |
parent | b52af20e7318e19b2becf5b191d22d6ccb7139b2 (diff) | |
download | scintilla-mirror-983d5165878df0190964a8f903c24055f9144612.tar.gz |
Add some operators to Point to simplify client code.
Diffstat (limited to 'include/Platform.h')
-rw-r--r-- | include/Platform.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/Platform.h b/include/Platform.h index c1924eda5..7a621c65e 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -108,6 +108,18 @@ public: return Point(static_cast<XYPOSITION>(x_), static_cast<XYPOSITION>(y_)); } + bool operator!=(Point other) const noexcept { + return (x != other.x) || (y != other.y); + } + + Point operator+(Point other) const noexcept { + return Point(x + other.x, y + other.y); + } + + Point operator-(Point other) const noexcept { + return Point(x - other.x, y - other.y); + } + // Other automatically defined methods (assignment, copy constructor, destructor) are fine }; |