[map] Implement operator[] for get()ting
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 29 May 2018 23:37:44 +0000 (16:37 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 29 May 2018 23:37:44 +0000 (16:37 -0700)
src/hb-map-private.hh

index 723dde4..6aaf4c4 100644 (file)
@@ -151,6 +151,9 @@ struct hb_map_t
     return get (key) != INVALID;
   }
 
+  inline hb_codepoint_t operator [] (unsigned int key) const
+  { return get (key); }
+
   static const hb_codepoint_t INVALID = HB_MAP_VALUE_INVALID;
 
   protected: