-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelops.h
More file actions
35 lines (27 loc) · 851 Bytes
/
Copy pathrelops.h
File metadata and controls
35 lines (27 loc) · 851 Bytes
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
// $Id: relops.h,v 1.1 2015-07-02 15:52:45-07 - - $
//
// Assuming that for any given type T, there are operators
// bool operator< (const T&, const T&);
// bool operator== (const T&, const T&);
// as fundamental comparisons for type T, define the other
// six operators in terms of the basic ones.
//
#ifndef __REL_OPS_H__
#define __REL_OPS_H__
template <typename value>
inline bool operator!= (const value &left, const value &right) {
return not (left == right);
}
template <typename value>
inline bool operator> (const value &left, const value &right) {
return right < left;
}
template <typename value>
inline bool operator<= (const value &left, const value &right) {
return not (right < left);
}
template <typename value>
inline bool operator>= (const value &left, const value &right) {
return not (left < right);
}
#endif