Standard comparer (valid as a static comparer). More...
#include <ogdf/basic/comparer.h>
Static Public Member Functions | |
| static bool | less (const E &x, const E &y) |
| static bool | leq (const E &x, const E &y) |
| static bool | greater (const E &x, const E &y) |
| static bool | geq (const E &x, const E &y) |
| static bool | equal (const E &x, const E &y) |
Standard comparer (valid as a static comparer).
Standard comparers are used by some sorting and searching methods. The implementation of the generic class only provides dummies that always throw a NoStdComparerException.
The compare operations are static, hence the StdComparer cannot only be used as a comparer object, but also as a static comparer when required.
You need to specialize this class for types you want to use with sorting and searching methods like quicksort and binary search. There already exist specializations for several standard types. If your type already provides compare operators, you can use the macro OGDF_STD_COMPARER to automatically generate the specialization based on these operators.
Definition at line 79 of file comparer.h.
| static bool ogdf::StdComparer< E >::equal | ( | const E & | x, |
| const E & | y | ||
| ) | [inline, static] |
Definition at line 86 of file comparer.h.
| static bool ogdf::StdComparer< E >::geq | ( | const E & | x, |
| const E & | y | ||
| ) | [inline, static] |
Definition at line 85 of file comparer.h.
| static bool ogdf::StdComparer< E >::greater | ( | const E & | x, |
| const E & | y | ||
| ) | [inline, static] |
Definition at line 84 of file comparer.h.
| static bool ogdf::StdComparer< E >::leq | ( | const E & | x, |
| const E & | y | ||
| ) | [inline, static] |
Definition at line 83 of file comparer.h.
| static bool ogdf::StdComparer< E >::less | ( | const E & | x, |
| const E & | y | ||
| ) | [inline, static] |
Definition at line 82 of file comparer.h.