Author: wyoung
Date: Thu Feb 7 03:47:02 2008
New Revision: 2162
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2162&view=rev
Log:
Added operator bool to tiny_int<T>. Not just a nicety: if you ask MySQL
for a bool column, it uses TINYINT(1), and our just-added sql_bool and
sql_boolean types are therefore aliases for sql_tinyint. So, if
someone uses one of these typedefs, they'll expect it to act like bool.
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=2162&r1=2161&r2=2162&view=diff
==============================================================================
--- trunk/lib/tiny_int.h (original)
+++ trunk/lib/tiny_int.h Thu Feb 7 03:47:02 2008
@@ -71,6 +71,12 @@
{
}
+ /// \brief Return truthiness of value
+ operator bool() const
+ {
+ return value_;
+ }
+
/// \brief Return value as an \c int.
operator int() const
{
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits