Author: wyoung
Date: Fri Apr 11 16:38:41 2008
New Revision: 2270
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2270&view=rev
Log:
Changed Query's safe bool mechanism to hide basic_ios::operator void*()
instead. This is arguably evil in general, but in this particular
instance, harmless.
Modified:
trunk/Wishlist
trunk/lib/query.cpp
trunk/lib/query.h
Modified: trunk/Wishlist
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=2270&r1=2269&r2=2270&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Fri Apr 11 16:38:41 2008
@@ -10,9 +10,6 @@
v3.0
----
- o Need something like Query::success() again, due to bool
- conversion ambiguity with some C++ standard libraries.
-
o Limit the number of active connections in examples/cpool.cpp.
Modified: trunk/lib/query.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.cpp?rev=2270&r1=2269&r2=2270&view=diff
==============================================================================
--- trunk/lib/query.cpp (original)
+++ trunk/lib/query.cpp Fri Apr 11 16:38:41 2008
@@ -233,9 +233,9 @@
return *this;
}
-Query::operator Query::private_bool_type() const
-{
- return *conn_ && copacetic_ ? &Query::copacetic_ : 0;
+Query::operator void*() const
+{
+ return *conn_ && copacetic_ ? const_cast<Query*>(this) : 0;
}
Modified: trunk/lib/query.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.h?rev=2270&r1=2269&r2=2270&view=diff
==============================================================================
--- trunk/lib/query.h (original)
+++ trunk/lib/query.h Fri Apr 11 16:38:41 2008
@@ -118,13 +118,6 @@
public std::ostream,
public OptionalExceptions
{
-private:
- /// \brief Pointer to bool data member, for use by safe bool
- /// conversion operator.
- ///
- /// \see http://www.artima.com/cppsource/safebool.html
- typedef bool Query::*private_bool_type;
-
public:
/// \brief Create a new query object attached to a connection.
///
@@ -254,7 +247,7 @@
/// This method returns false if either the Query object or its
/// associated Connection object has seen an error condition since
/// the last operation.
- operator private_bool_type() const;
+ operator void*() const;
/// \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