blob: ec5bc650c8cdd3c855e58bf584333af4f753aa09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#ifndef __2GEOM_ORD__
#define __2GEOM_ORD__
namespace {
enum Cmp {
LESS_THAN=-1,
GREATER_THAN=1,
EQUAL_TO=0
};
inline Cmp operator-(Cmp x) {
switch(x) {
case LESS_THAN:
return GREATER_THAN;
case GREATER_THAN:
return LESS_THAN;
case EQUAL_TO:
return EQUAL_TO;
}
}
template <typename T1, typename T2>
inline Cmp cmp(T1 const &a, T2 const &b) {
if ( a < b ) {
return LESS_THAN;
} else if ( b < a ) {
return GREATER_THAN;
} else {
return EQUAL_TO;
}
}
}
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
|