Advertisement
tattersail

Point.h

Apr 13th, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1.  
  2. #ifndef POINT_GUARD
  3. #define POINT_GUARD
  4.  
  5. //typedef void (*Callback)(void*,void*);
  6.  
  7. namespace Graph_lib {
  8.  
  9. struct Point {
  10. int x, y;
  11. Point(int xx, int yy) : x(xx), y(yy) { }
  12. Point() :x(0), y(0) { }
  13.  
  14. Point& operator+=(Point d) { x+=d.x; y+=d.y; return *this; }
  15. };
  16.  
  17. inline bool operator==(Point a, Point b) { return a.x == b.x && a.y == b.y; }
  18.  
  19. inline bool operator!=(Point a, Point b) { return !(a == b); }
  20.  
  21.  
  22. }
  23. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement