15 #ifndef STL_COMPARES_H 16 #define STL_COMPARES_H 18 #include "dtoolbase.h" 20 #include "nearly_zero.h" 28 template<
class Key,
class Compare = less<Key> >
31 INLINE
bool is_equal(
const Key &a,
const Key &b)
const {
32 return !operator()(a, b) && !operator()(b, a);
42 template<
class Key,
class Compare = less<Key> >
45 INLINE
size_t operator () (
const Key &key)
const {
48 INLINE
bool operator () (
const Key &a,
const Key &b)
const {
49 return Compare::operator ()(a, b);
51 INLINE
bool is_equal(
const Key &a,
const Key &b)
const {
52 return !operator()(a, b) && !operator()(b, a);
56 #endif // HAVE_STL_HASH 67 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
81 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
82 INLINE
bool is_equal(
const Key &a,
const Key &b)
const;
95 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
108 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
109 INLINE
bool is_equal(
const Key &a,
const Key &b)
const;
124 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
125 INLINE
bool is_equal(
const Key &a,
const Key &b)
const;
136 template<
class Key,
class Compare = less<Key> >
139 INLINE
static size_t add_hash(
size_t start,
const Key &key);
150 INLINE
static size_t add_hash(
size_t start,
const void *key);
161 INLINE
size_t operator () (
const Key &key)
const;
162 INLINE
bool operator () (
const Key &a,
const Key &b)
const;
163 INLINE
size_t add_hash(
size_t start,
const Key &key)
const;
164 const Key _threshold;
173 template<
class Key,
class Compare = less<Key> >
176 INLINE
size_t operator () (
const Key &key)
const;
177 INLINE
bool operator () (
const Key &a,
const Key &b)
const {
180 INLINE
static size_t add_hash(
size_t start,
const Key &key);
189 template<
class Key,
class Compare = less<Key> >
192 INLINE
size_t operator () (
const Key &key)
const;
193 INLINE
bool operator () (
const Key &a,
const Key &b)
const {
205 template<
class Key,
class Compare>
208 INLINE
size_t operator () (
const Key &key)
const;
209 INLINE
bool operator () (
const Key &a,
const Key &b)
const {
227 INLINE
size_t operator () (
const Key &key)
const;
228 INLINE
bool is_equal(
const Key &a,
const Key &b)
const;
231 #include "stl_compares.I" An STL function object class, this is intended to be used on any ordered collection of pointers to cl...
This hash_compare class hashes a class object.
This hash_compare class hashes a string.
This hash_compare class hashes a float or a double.
This hash_compare class hashes a pointer to a class object.
An STL function object class, this is intended to be used on any ordered collection of pointers to cl...
An STL function object class, this is intended to be used on any ordered collection of pointers to cl...
This is the default hash_compare class, which assumes the Key is a size_t value or can be implicitly ...
This is the default hash_compare class, which assumes the Key is a pointer value. ...
Compares two floating point numbers, within threshold of equivalence.
An STL function object class, this is intended to be used on any ordered collection of class objects ...
An STL function object class, this is intended to be used on any ordered collection of pointers to cl...