Author: wyoung
Date: Wed Nov 28 09:31:43 2007
New Revision: 1914
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1914&view=rev
Log:
Doxygen comment improvement
Modified:
trunk/Wishlist
trunk/lib/refcounted.h
Modified: trunk/Wishlist
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=1914&r1=1913&r2=1914&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Wed Nov 28 09:31:43 2007
@@ -16,9 +16,6 @@
o The manipulator changes sometime during 2.3 broke the column
formatting of the examples that dump tables. A setw(x) call
results in x spaces, not x - strlen(whatevercamebefore).
-
- o Do the full-on SafeBool<T> thing in RefCountedPointer? Or is
- the new operator void*() stuff sufficient?
o Classes Connection, Query, String, Result and Row all have
operator bool() as well. Use "safe bool" here too?
Modified: trunk/lib/refcounted.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/refcounted.h?rev=1914&r1=1913&r2=1914&view=diff
==============================================================================
--- trunk/lib/refcounted.h (original)
+++ trunk/lib/refcounted.h Wed Nov 28 09:31:43 2007
@@ -204,6 +204,20 @@
/// This isn't intended to be used directly; if you need the
/// pointer, call raw() instead. It's used internally by the
/// compiler to implement operators bool, ==, and !=
+ ///
+ /// \b WARNING: This makes it possible to say
+ /// \code
+ /// RefCountedPointer<Foo> bar(new Foo);
+ /// delete bar;
+ /// \endcode
+ ///
+ /// This will almost kinda sorta do the right thing: the Foo
+ /// object held by the refcounted pointer will be destroyed as
+ /// you wanted, but then when the refcounted pointer goes out of
+ /// scope, the memory is deleted a second time, which will probably
+ /// crash your program. This is easy to accidentally do when
+ /// converting a good ol' unmanaged pointer to a refcounted pointer
+ /// and forgetting to remove the delete calls needed previously.
operator void*()
{
return counted_;
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits