From db56d481cdfe848240d0f009656d290cf7e63d14 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 30 Nov 2018 19:49:03 -0500 Subject: Another approach to fixing pesky-gcc's ambiguous overload overload --- src/hb-vector.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hb-vector.hh b/src/hb-vector.hh index 313c24c4..ef9d99d5 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -90,6 +90,9 @@ struct hb_vector_t return Null(Type); return arrayZ()[i]; } + /* Catch int index and deflect to unsigned int. */ + inline Type& operator [] (int i) { return (*this)[(unsigned int) i]; } + inline const Type& operator [] (int i) const { return (*this)[(unsigned int) i]; } inline hb_array_t as_array (void) { return hb_array (arrayZ(), len); } -- cgit v1.2.1