Last active
April 29, 2017 02:16
-
-
Save rharriso/495cffd534b8071edf517f253c6d60a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct coord { | |
int i = 0; | |
int j = 0; | |
}; | |
// equality comparison between two coors | |
inline bool operator == (const coord &lhs, const coord &rhs) { | |
return lhs.i == rhs.i && lhs.j == rhs.j; | |
} | |
// less then comparison between two coords | |
inline bool operator < (const coord &lhs, const coord &rhs) { | |
return lhs.i < rhs.i || (lhs.i == rhs.i && lhs.j < rhs.j); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment