-
Notifications
You must be signed in to change notification settings - Fork 0
/
Point.h
29 lines (18 loc) · 783 Bytes
/
Point.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//
// This is a GUI support code to the chapters 12-16 of the book
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#ifndef POINT_GUARD
#define POINT_GUARD
//------------------------------------------------------------------------------
struct Point {
int x, y;
Point(int xx, int yy) : x(xx), y(yy) { }
Point() :x(0), y(0) { }
};
//------------------------------------------------------------------------------
inline bool operator==(Point a, Point b) { return a.x==b.x && a.y==b.y; }
//------------------------------------------------------------------------------
inline bool operator!=(Point a, Point b) { return !(a==b); }
//------------------------------------------------------------------------------
#endif // POINT_GUARD