projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab011bb
)
Add some operators.
author
Carl Hetherington
<cth@carlh.net>
Fri, 13 Jun 2014 11:03:02 +0000
(12:03 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Fri, 13 Jun 2014 11:03:02 +0000
(12:03 +0100)
src/lib/position.h
patch
|
blob
|
history
diff --git
a/src/lib/position.h
b/src/lib/position.h
index d68fcb1af9a02aa6cf1a3cb0e452e5718c7f4aa2..345f7ab4a85bcd8b0cd7565543e4736f26e90968 100644
(file)
--- a/
src/lib/position.h
+++ b/
src/lib/position.h
@@
-50,4
+50,18
@@
operator+ (Position<T> const & a, Position<T> const & b)
return Position<T> (a.x + b.x, a.y + b.y);
}
+template<class T>
+Position<T>
+operator- (Position<T> const & a, Position<T> const & b)
+{
+ return Position<T> (a.x - b.x, a.y - b.y);
+}
+
+template<class T>
+bool
+operator== (Position<T> const & a, Position<T> const & b)
+{
+ return a.x == b.x && a.y == b.y;
+}
+
#endif