#include <defop.h>
Inheritance diagram for TLDefaultOperators_Relational< T >:
Static Public Member Functions | |
template<typename T2> bool | lt (T const &a, T2 const &b) |
template<typename T2> bool | le (T const &a, T2 const &b) |
template<typename T2> bool | gt (T const &a, T2 const &b) |
template<typename T2> bool | ge (T const &a, T2 const &b) |
template<typename T2> bool | eq (T const &a, T2 const &b) |
template<typename T2> bool | ne (T const &a, T2 const &b) |
Definition at line 39 of file defop.h.
|
|
|
|
|
|
|
|
|
Relational operators. Only smaller and smaller/equal would be needed but in order to allow comparisons between different types, I also introduced greater and greater/equal since it is then possible to have the _other_ type as second argument always. This is useful for searching when the _other_ type is the key and the primary type is the node (T) and we only want to implement relational operators as member. (Simply define operator<(const KEY &), etc; no need to have operator<(KEY,T)!) There is a euqal and non-equal version since using !(a==b) instead of a!=b may be inefficient for some types. |
|
|