[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
pull/1136/head
Behdad Esfahbod 6 years ago
parent 79e21984b1
commit 66920a6bac
  1. 2
      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)

Loading…
Cancel
Save