[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:
parent
79e21984b1
commit
66920a6bac
|
@ -72,7 +72,7 @@ struct Iter<T *>
|
||||||
array (array_), length (length_) {}
|
array (array_), length (length_) {}
|
||||||
|
|
||||||
/* Emptiness. */
|
/* Emptiness. */
|
||||||
inline operator bool (void) const { return bool (length); }
|
explicit inline operator bool (void) const { return bool (length); }
|
||||||
|
|
||||||
/* Current item. */
|
/* Current item. */
|
||||||
inline T &operator * (void)
|
inline T &operator * (void)
|
||||||
|
|
Loading…
Reference in New Issue