소스 검색

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

Hugh 11 년 전
부모
커밋
fc26718d2d
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      std/cpp/_std/haxe/ds/IntMap.hx

+ 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> {