4#include <click/hashcode.hh>
8template <
class T,
class U>
12 typedef U second_type;
14 typedef const T &key_const_reference;
24 : first(t), second(U(unused)) {
29 : first(t), second(u) {
32 inline Pair(
const Pair<T, U> &p)
33 : first(p.first), second(p.second) {
36 template <
typename V,
typename W>
37 inline Pair(
const Pair<V, W> &p)
38 : first(p.first), second(p.second) {
41 typedef hashcode_t (Pair<T, U>::*unspecified_bool_type)() const;
42 inline operator unspecified_bool_type()
const {
43 return first || second ? &Pair<T, U>::hashcode : 0;
46 inline const T &hashkey()
const {
50 inline hashcode_t hashcode()
const;
52 template <
typename V,
typename W>
53 Pair<T, U> &operator=(
const Pair<V, W> &p) {
61template <
class T,
class U>
62inline bool operator==(
const Pair<T, U> &a,
const Pair<T, U> &b)
64 return a.first == b.first && a.second == b.second;
67template <
class T,
class U>
68inline bool operator!=(
const Pair<T, U> &a,
const Pair<T, U> &b)
70 return a.first != b.first || a.second != b.second;
73template <
class T,
class U>
74inline bool operator<(
const Pair<T, U> &a,
const Pair<T, U> &b)
76 return a.first < b.first
77 || (!(b.first < a.first) && a.second < b.second);
80template <
class T,
class U>
81inline hashcode_t Pair<T, U>::hashcode()
const
83 return (CLICK_NAME(hashcode)(first) << 7) ^ CLICK_NAME(hashcode)(second);
86template <
class T,
class U>
87inline Pair<T, U> make_pair(T t, U u)
89 return Pair<T, U>(t, u);
Template defining a fast argument type for objects of type T.
Definition type_traits.hh:148