/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define DCPOMATIC_POSITION_H
/** @struct Position
- * @brief A position.
+ * @brief A position (x and y coordinates)
*/
template <class T>
class Position
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;
+}
+
+template<class T>
+bool
+operator!= (Position<T> const & a, Position<T> const & b)
+{
+ return a.x != b.x || a.y != b.y;
+}
+
#endif