123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #ifndef PAIR_H
- #define PAIR_H
- template <class F, class S>
- struct Pair {
- F first;
- S second;
- Pair() {}
- Pair(F p_first, const S &p_second) :
- first(p_first),
- second(p_second) {
- }
- };
- template <class F, class S>
- bool operator==(const Pair<F, S> &pair, const Pair<F, S> &other) {
- return (pair.first == other.first) && (pair.second == other.second);
- }
- template <class F, class S>
- bool operator!=(const Pair<F, S> &pair, const Pair<F, S> &other) {
- return (pair.first != other.first) || (pair.second != other.second);
- }
- template <class F, class S>
- struct PairSort {
- bool operator()(const Pair<F, S> &A, const Pair<F, S> &B) const {
- return A.first < B.first;
- }
- };
- #endif
|