-
Notifications
You must be signed in to change notification settings - Fork 14
/
Util.h
38 lines (29 loc) · 852 Bytes
/
Util.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
29
30
31
32
33
34
35
36
37
38
//
// Created by yche on 9/5/17.
//
#ifndef PPSCAN_DATA_STRUCTURE_UTIL_H
#define PPSCAN_DATA_STRUCTURE_UTIL_H
#include <memory>
namespace yche {
constexpr int NOT_SIMILAR = -2;
constexpr int SIMILAR = -1;
constexpr char TRUE = 1;
constexpr char FALSE = 0;
constexpr char UN_KNOWN = 0;
constexpr char CORE = 1;
constexpr char NON_CORE = 2;
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args &&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
}
namespace std {
template<>
struct hash<std::pair<int, int>> {
inline size_t operator()(const std::pair<int, int> &v) const {
std::hash<int> int_hasher;
return int_hasher(v.first) ^ int_hasher(v.second);
}
};
}
#endif //PPSCAN_DATA_STRUCTURE_UTIL_H