[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Aug 6 22:33:33 UTC 2018


 src/hb-iter-private.hh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 66920a6bace7c54c8166c4ed938b6ffc5fabcf2b
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Aug 6 15:32:13 2018 -0700

    [iter] Make operator bool explicit
    
    We would need to write:
    
      for (Iter<T> it (...); bool (t); t++)
    
    instead of:
    
      for (Iter<T> it (...); t; t++)
    
    But I think it's an improvement in code readability in the long term.
    
    Fixes https://github.com/harfbuzz/harfbuzz/issues/1127

diff --git a/src/hb-iter-private.hh b/src/hb-iter-private.hh
index 410a50f9..039a7734 100644
--- a/src/hb-iter-private.hh
+++ b/src/hb-iter-private.hh
@@ -72,7 +72,7 @@ struct Iter<T *>
     array (array_), length (length_) {}
 
   /* Emptiness. */
-  inline operator bool (void) const { return bool (length); }
+  explicit inline operator bool (void) const { return bool (length); }
 
   /* Current item. */
   inline T &operator * (void)


More information about the HarfBuzz mailing list