-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutility.h
More file actions
69 lines (58 loc) · 1.95 KB
/
utility.h
File metadata and controls
69 lines (58 loc) · 1.95 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef SJTU_UTILITY_HPP
#define SJTU_UTILITY_HPP
#include <utility>
namespace sjtu {
template<class T1, class T2>
class pair {
public:
T1 first;
T2 second;
constexpr pair() : first(), second() {}
pair(const pair &other) = default;
pair(pair &&other) = default;
pair(const T1 &x, const T2 &y) : first(x), second(y) {}
template<class U1, class U2>
pair(U1 &&x, U2 &&y) : first(x), second(y) {}
template<class U1, class U2>
pair(const pair<U1, U2> &other) : first(other.first), second(other.second) {}
template<class U1, class U2>
pair(pair<U1, U2> &&other) : first(other.first), second(other.second) {}
// template <class U1, class U2>
// friend bool operator<(const pair<U1, U2>& x, const pair<U1, U2>& y) {
// return x.first < y.first ;
// }
//
// template <class U1, class U2>
// friend bool operator==(const pair<U1, U2>& x, const pair<U1, U2>& y) {
// return x.first == y.first ;
// }
//
// template <class U1, class U2>
// friend bool operator>(const pair<U1, U2>& x, const pair<U1, U2>& y) {
// return x.first>y.first;
// }
//
// template <class U1, class U2>
// friend bool operator<=(const pair<U1, U2>& x, const pair<U1, U2>& y) {
// return x.first<=y.first;
// }
//
// template <class U1, class U2>
// friend bool operator>=(const pair<U1, U2>& x, const pair<U1, U2>& y) {
// return x.first>=y.first;
// }
//
// template <class U1, class U2>
// friend bool operator!=(const pair<U1, U2>& x, const pair<U1, U2>& y) {
// return x.first!=y.first;
// }
//
// const pair<T1,T2> &operator=(const pair<T1,T2> &a){
// if(this==&a) return *this;
// first=a.first;
// second=a.second;
// return *this;
// }
};
}
#endif