2
0
Эх сурвалжийг харах

[cpp] Use template to cast Dynamic key to int in IntMap. Closes #3355

Hugh 11 жил өмнө
parent
commit
fc26718d2d

+ 3 - 1
std/cpp/_std/haxe/ds/IntMap.hx

@@ -34,7 +34,9 @@ package haxe.ds;
   inline void set(int key, float value) { __int_hash_set_float(h,key,value); }
   inline void set(int key, double value) { __int_hash_set_float(h,key,value); }
   inline void set(int key, ::String value) { __int_hash_set_string(h,key,value); }
-  inline Void set(Dynamic key, ::Dynamic value) { __int_hash_set(h,key,value); return null(); }
+
+  template<typename VALUE>
+  inline void set(Dynamic &key, const VALUE &value) { set( (int)key, value ); }
 ")
 @:coreApi class IntMap<T> implements haxe.Constraints.IMap<Int,T> {