From 66920a6bace7c54c8166c4ed938b6ffc5fabcf2b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 6 Aug 2018 15:32:13 -0700 Subject: [PATCH] [iter] Make operator bool explicit We would need to write: for (Iter it (...); bool (t); t++) instead of: for (Iter 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 --- src/hb-iter-private.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-iter-private.hh b/src/hb-iter-private.hh index 410a50f..039a773 100644 --- a/src/hb-iter-private.hh +++ b/src/hb-iter-private.hh @@ -72,7 +72,7 @@ struct Iter 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) -- 2.7.4