aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-09 17:04:41 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-09 17:04:41 +0000
commit65ed9efb56ad967c8349eeca61402239d6f8af9d (patch)
tree70caf8016d0f93b44307345ab2ebedc9f7abfa86
parentdee716a164a48efaee7f70c24779ca27664cf390 (diff)
downloadpaludis-65ed9efb56ad967c8349eeca61402239d6f8af9d.tar.gz
paludis-65ed9efb56ad967c8349eeca61402239d6f8af9d.tar.xz
Use operator const void * rather than operator bool for CountedPtr to avoid bool -> int conversion weirdness.
-rw-r--r--paludis/util/counted_ptr.hh12
1 files changed, 8 insertions, 4 deletions
diff --git a/paludis/util/counted_ptr.hh b/paludis/util/counted_ptr.hh
index 46a4adc..3053eb7 100644
--- a/paludis/util/counted_ptr.hh
+++ b/paludis/util/counted_ptr.hh
@@ -178,9 +178,11 @@ namespace paludis
///\}
/**
- * Not null?
+ * Return whether we are null. We use const void * rather than bool
+ * here to avoid bool -> int conversion weirdness. See \ref
+ * TCppPL 21.3.3.
*/
- operator bool() const
+ operator const void * () const
{
return _ptr;
}
@@ -269,9 +271,11 @@ namespace paludis
///\}
/**
- * Not null?
+ * Return whether we are null. We use const void * rather than bool
+ * here to avoid bool -> int conversion weirdness. See \ref
+ * TCppPL 21.3.3.
*/
- operator bool() const
+ operator const void * () const
{
return _ptr;
}