Author: wyoung
Date: Fri Feb 27 18:00:43 2009
New Revision: 2458

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2458&view=rev
Log:
Added comparison operators to tiny_int<T>.  Patch by Edward Diener
<[email protected]>

Modified:
    trunk/lib/tiny_int.h

Modified: trunk/lib/tiny_int.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/tiny_int.h?rev=2458&r1=2457&r2=2458&view=diff
==============================================================================
--- trunk/lib/tiny_int.h (original)
+++ trunk/lib/tiny_int.h Fri Feb 27 18:00:43 2009
@@ -258,6 +258,42 @@
                return value_ >> i.value_;
        }
 
+       /// \brief Check for equality
+       bool operator ==(const this_type& i) const
+       {
+               return value_ == i.value_;
+       }
+
+       /// \brief Check for inequality
+       bool operator !=(const this_type& i) const
+       {
+               return value_ != i.value_;
+       }
+
+       /// \brief Check that this object is less than another
+       bool operator <(const this_type& i) const
+       {
+               return value_ < i.value_;
+       }
+
+       /// \brief Check that this object is greater than another
+       bool operator >(const this_type& i) const
+       {
+               return value_ > i.value_;
+       }
+
+       /// \brief Check this object is less than or equal to another
+       bool operator <=(const this_type& i) const
+       {
+               return value_ <= i.value_;
+       }
+
+       /// \brief Check this object is greater than or equal to another
+       bool operator >=(const this_type& i) const
+       {
+               return value_ >= i.value_;
+       }
+
 private:
        value_type value_;
 };


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to