[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
This commit is contained in:
Behdad Esfahbod 2018-08-06 15:32:13 -07:00
parent 79e21984b1
commit 66920a6bac
1 changed files with 1 additions and 1 deletions

View File

@ -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)