aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/nullable.hxx33
1 files changed, 33 insertions, 0 deletions
diff --git a/odb/nullable.hxx b/odb/nullable.hxx
index ccfe01b..80a76c1 100644
--- a/odb/nullable.hxx
+++ b/odb/nullable.hxx
@@ -60,6 +60,39 @@ namespace odb
}
template <typename T>
+ inline bool
+ operator== (const nullable<T>& x, const nullable<T>& y)
+ {
+ return x.null () == y.null () && (x.null () || *x == *y);
+ }
+
+ template <typename T>
+ inline bool
+ operator!= (const nullable<T>& x, const nullable<T>& y) {return !(x == y);}
+
+ template <typename T>
+ inline bool
+ operator< (const nullable<T>& x, const nullable<T>& y)
+ {
+ return x.null () > y.null () || (!x.null () && !y.null () && *x < *y);
+ }
+
+ template <typename T>
+ inline bool
+ operator> (const nullable<T>& x, const nullable<T>& y)
+ {
+ return x.null () < y.null () || (!x.null () && !y.null () && *x > *y);
+ }
+
+ template <typename T>
+ inline bool
+ operator<= (const nullable<T>& x, const nullable<T>& y) {return !(x > y);}
+
+ template <typename T>
+ inline bool
+ operator>= (const nullable<T>& x, const nullable<T>& y) {return !(x < y);}
+
+ template <typename T>
inline nullable<T>::
nullable ()
: null_ (true)