📄 pair.hh
字号:
// -*- c-basic-offset: 4 -*-#ifndef CLICK_PAIR_HH#define CLICK_PAIR_HHtemplate <class T, class U>struct Pair { T first; U second; Pair() : first(), second() { } Pair(const T &t, const U &u) : first(t), second(u) { } inline operator bool() const;};template <class T, class U>inline Pair<T, U>::operator bool() const{ return (bool) first || (bool) second;}template <class T, class U>inline bool operator==(const Pair<T, U> &a, const Pair<T, U> &b){ return a.first == b.first && a.second == b.second;}template <class T, class U>inline bool operator!=(const Pair<T, U> &a, const Pair<T, U> &b){ return a.first != b.first || a.second != b.second;}template <class T, class U>inline bool operator<(const Pair<T, U> &a, const Pair<T, U> &b){ return a.first < b.first || (!(b.first < a.first) && a.second < b.second);}template <class T, class U>inline unsigned hashcode(const Pair<T, U> &a){ return (hashcode(a.first) << 13) ^ hashcode(a.second);}template <class T, class U>inline Pair<T, U> make_pair(const T &t, const U &u){ return Pair<T, U>(t, u);}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -