Author: wyoung
Date: Tue May 18 02:50:38 2010
New Revision: 2634
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2634&view=rev
Log:
Added Query::operator!(), overriding basic_ios version so that
"if (!query)" does the right thing. Fixes problem report in thread
http://lists.mysql.com/plusplus/8594
Modified:
trunk/Wishlist
trunk/lib/query.h
Modified: trunk/Wishlist
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=2634&r1=2633&r2=2634&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Tue May 18 02:50:38 2010
@@ -17,10 +17,6 @@
v3.1 Plan
---------
- o Can we fix "if (!query)" without changing the ABI?
-
- http://lists.mysql.com/plusplus/8594
-
o Fix pedantic warning:
lib/null.h:55: warning: type qualifiers ignored on function return type
Modified: trunk/lib/query.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.h?rev=2634&r1=2633&r2=2634&view=diff
==============================================================================
--- trunk/lib/query.h (original)
+++ trunk/lib/query.h Tue May 18 02:50:38 2010
@@ -245,6 +245,15 @@
/// the last operation.
operator void*() const;
+ /// \brief Returns true if the query object is not in a bad state
+ ///
+ /// This just returns the opposite of operator void*(), and is
+ /// required only because basic_ios defines it, so we have to
+ /// override it to get Query-specific behavior in code like
+ ///
+ /// \code if (!query) ...
+ bool operator !() const { return !operator void*(); }
+
/// \brief Treat the contents of the query string as a template
/// query.
///
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits