[glibmm] RefPtr: Make operator bool() explicit.



commit aee3a6fa6a37e1178b43437966b4225a34f9c6e2
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Apr 10 13:32:49 2016 +0200

    RefPtr: Make operator bool() explicit.
    
    As in shared_ptr<>, for instance.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=626858#c4

 glib/glibmm/refptr.h |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h
index 4d8a9c6..892b6a6 100644
--- a/glib/glibmm/refptr.h
+++ b/glib/glibmm/refptr.h
@@ -165,7 +165,7 @@ public:
    *     do_something();
    * @endcode
    */
-  inline operator bool() const noexcept;
+  inline explicit operator bool() const noexcept;
 
 #ifndef GLIBMM_DISABLE_DEPRECATED
   /// @deprecated Use reset() instead because this leads to confusion with clear() methods on the
@@ -221,10 +221,6 @@ public:
   template <class T_CastFrom>
   static inline RefPtr cast_const(const RefPtr<T_CastFrom>& src) noexcept;
 
-  // TODO: Maybe remove these if we replace operator bool() with operator const void* after
-  // an API/ABI break, as suggested by Daniel Elstner? murrayc.
-  // See bug https://bugzilla.gnome.org/show_bug.cgi?id=626858
-
   /** Compare based on the underlying instance address.
    *
    * This is needed in code that requires an ordering on


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]