[iter] Implement range-based for loops

Part of https://github.com/harfbuzz/harfbuzz/issues/1648
diff --git a/src/hb-array.hh b/src/hb-array.hh
index b4619ee..37ca63d 100644
--- a/src/hb-array.hh
+++ b/src/hb-array.hh
@@ -80,6 +80,8 @@
     length -= n;
   }
   unsigned __len__ () const { return length; }
+  bool operator != (const hb_array_t& o) const
+  { return arrayZ != o.arrayZ || length != o.length; }
 
   /* Extra operators.
    */
@@ -224,6 +226,10 @@
   hb_sorted_array_t& operator = (const hb_array_t<U> &o)
   { hb_array_t<Type> (*this) = o; return *this; }
 
+  /* Iterator implementation. */
+  bool operator != (const hb_sorted_array_t& o) const
+  { return this->arrayZ != o.arrayZ || this->length != o.length; }
+
   hb_sorted_array_t<Type> sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const
   { return hb_sorted_array_t<Type> (((const hb_array_t<Type> *) (this))->sub_array (start_offset, seg_count)); }
   hb_sorted_array_t<Type> sub_array (unsigned int start_offset, unsigned int seg_count) const