Fixes for C++98
[junction.git] / junction / extra / impl / MapAdapter_StdMap.h
index 4d287cc4df4035b3734285ffc85cac1dab1f1efd..9ec81dacc3a47ea2121b6647a11eb3d4b422b9d8 100644 (file)
@@ -22,7 +22,7 @@ namespace extra {
 
 class MapAdapter {
 public:
-    static TURF_CONSTEXPR const char* MapName = "std::map + std::mutex";
+    static TURF_CONSTEXPR const char* getMapName() { return "std::map + std::mutex"; }
 
     MapAdapter(ureg) {
     }
@@ -52,9 +52,9 @@ public:
         Map(ureg) {
         }
 
-        void insert(u32 key, void* value) {
+        void assign(u32 key, void* value) {
             std::lock_guard<std::mutex> guard(m_mutex);
-            m_map.insert(std::make_pair(key, value));
+            m_map[key] = value;
         }
 
         void* get(u32 key) {
@@ -62,7 +62,7 @@ public:
             MapType::iterator iter = m_map.find(key);
             return (iter == m_map.end()) ? NULL : iter->second;
         }
-    
+
         void erase(u32 key) {
             std::lock_guard<std::mutex> guard(m_mutex);
             m_map.erase(key);