15 #include <stxxl/types>
18 template <
typename KEY,
unsigned SIZE>
24 char _data[SIZE -
sizeof(key_type)];
27 my_type(key_type __key) : _key(__key) { }
36 static my_type<KEY, SIZE> min_value()
38 return my_type<KEY, SIZE>(std::numeric_limits<key_type>::min());
40 static my_type<KEY, SIZE> max_value()
42 return my_type<KEY, SIZE>(std::numeric_limits<key_type>::max());
46 template <
typename KEY,
unsigned SIZE>
47 std::ostream & operator << (std::ostream & o, const my_type<KEY, SIZE> obj)
59 template <
typename KEY,
unsigned SIZE>
60 bool operator < (const my_type<KEY, SIZE> & a,
const my_type<KEY, SIZE> & b)
62 return a._key < b._key;
65 template <
typename KEY,
unsigned SIZE>
66 bool operator == (
const my_type<KEY, SIZE> & a,
const my_type<KEY, SIZE> & b)
68 return a._key == b._key;
71 template <
typename KEY,
unsigned SIZE>
72 bool operator != (
const my_type<KEY, SIZE> & a,
const my_type<KEY, SIZE> & b)
74 return a._key != b._key;
78 struct Cmp :
public std::less<T>
80 bool operator () (
const T & a,
const T & b)
const
82 return a._key < b._key;
87 return T::min_value();
91 return T::max_value();
97 template <
typename KEY,
unsigned SIZE>
98 bool operator < (const my_type<KEY, SIZE> & a,
const my_type<KEY, SIZE> & b)
100 return a.key() < b.key();
107 unsigned operator () ()