[pangomm] C++11: AttrIter, AttrList, Color: Make operator bool() explicit.



commit 9fa7699a3028217ff4dc77cbcf148767accb689a
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Apr 10 14:23:04 2016 +0200

    C++11: AttrIter, AttrList, Color: Make operator bool() explicit.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=626858#c4

 pango/src/attriter.hg |    2 +-
 pango/src/attrlist.hg |    4 ++--
 pango/src/color.hg    |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/pango/src/attriter.hg b/pango/src/attriter.hg
index 9b33013..2b8d898 100644
--- a/pango/src/attriter.hg
+++ b/pango/src/attriter.hg
@@ -60,7 +60,7 @@ public:
   /** Check whether the iterator is valid.
    * @return <tt>true</tt> if the iterator is valid.
    */
-  operator bool() const;
+  explicit operator bool() const;
 
   /** The same as operator++().
    * @return <tt>false</tt> if the end of the list is reached.
diff --git a/pango/src/attrlist.hg b/pango/src/attrlist.hg
index 9618b87..768737d 100644
--- a/pango/src/attrlist.hg
+++ b/pango/src/attrlist.hg
@@ -72,11 +72,11 @@ public:
 
   _DEPRECATE_IFDEF_START
   ///@deprecated Use the const version
-  operator bool();
+  explicit operator bool();
   _DEPRECATE_IFDEF_END
 
   ///Tests whether the AttrList is valid.
-  operator bool() const;
+  explicit operator bool() const;
 
   void insert(Attribute& attr);
   _IGNORE(pango_attr_list_insert) // hand code because we need to pass a copy of the attribute
diff --git a/pango/src/color.hg b/pango/src/color.hg
index fbe5b73..f39a6c7 100644
--- a/pango/src/color.hg
+++ b/pango/src/color.hg
@@ -35,11 +35,11 @@ public:
 
   _DEPRECATE_IFDEF_START
   /// @deprecated Use the const version.
-  operator bool();
+  explicit operator bool();
   _DEPRECATE_IFDEF_END
 
   /// Tests whether the Color is valid.
-  operator bool() const;
+  explicit operator bool() const;
   
   /** Gets the red component of the color.
    * @return The red component of the color. This is a value between 0 and 65535, with 65535 indicating full 
intensity.


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