diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp index 07c320aa7e..4427a4f105 100644 --- a/source/graphics/ObjectEntry.cpp +++ b/source/graphics/ObjectEntry.cpp @@ -165,7 +165,7 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections { CSkeletonAnim* anim = model->BuildAnimation(it->second.m_FileName, name, it->second.m_Speed, it->second.m_ActionPos, it->second.m_ActionPos2, it->second.m_SoundPos); if (anim) - m_Animations.emplace(std::move(name), anim); + m_Animations.insert(std::make_pair(name, anim)); } } diff --git a/source/graphics/ShaderDefines.cpp b/source/graphics/ShaderDefines.cpp index 56c437a824..57a65e5321 100644 --- a/source/graphics/ShaderDefines.cpp +++ b/source/graphics/ShaderDefines.cpp @@ -94,7 +94,7 @@ typename CShaderParams::SItems* CShaderParams::GetInterned(con ENSURE(std::adjacent_find(items.items.begin(), items.items.end(), std::binary_negate(Cmp())) == items.items.end()); shared_ptr ptr(new SItems(items)); - s_InternedItems.emplace(items, ptr); + s_InternedItems.insert(std::make_pair(items, ptr)); return ptr.get(); } diff --git a/source/lib/sysdep/os/linux/dir_watch_inotify.cpp b/source/lib/sysdep/os/linux/dir_watch_inotify.cpp index 5cfbd49c33..4f7f5b9dc1 100644 --- a/source/lib/sysdep/os/linux/dir_watch_inotify.cpp +++ b/source/lib/sysdep/os/linux/dir_watch_inotify.cpp @@ -216,7 +216,7 @@ Status dir_watch_Add(const OsPath& path, PDirWatch& dirWatch) dirWatch.swap(tmpDirWatch); dirWatch->path = path; dirWatch->reqnum = wd; - g_paths.emplace(wd, dirWatch); + g_paths.insert(std::make_pair(wd, dirWatch)); return INFO::OK; } diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp index 9cc3dc2cd6..b770f51ef5 100644 --- a/source/lobby/XmppClient.cpp +++ b/source/lobby/XmppClient.cpp @@ -637,7 +637,7 @@ void XmppClient::SendMUCMessage(const std::string& message) */ void XmppClient::PushGuiMessage(XmppClient::GUIMessage message) { - m_GuiMessageQueue.emplace_back(message); + m_GuiMessageQueue.push_back(std::move(message)); } /** diff --git a/source/network/NetTurnManager.cpp b/source/network/NetTurnManager.cpp index 47868df64b..aa60c5ca73 100644 --- a/source/network/NetTurnManager.cpp +++ b/source/network/NetTurnManager.cpp @@ -289,8 +289,7 @@ void CNetTurnManager::AddCommand(int client, int player, JS::HandleValue data, u return; } - SimulationCommand cmd(player, m_Simulation2.GetScriptInterface().GetContext(), data); - m_QueuedCommands[turn - (m_CurrentTurn+1)][client].emplace_back(std::move(cmd)); + m_QueuedCommands[turn - (m_CurrentTurn+1)][client].emplace_back(player, m_Simulation2.GetScriptInterface().GetContext(), data); } void CNetTurnManager::FinishedAllCommands(u32 turn, u32 turnLength) diff --git a/source/ps/CStrIntern.cpp b/source/ps/CStrIntern.cpp index dc2361a070..9fe9eb93d3 100644 --- a/source/ps/CStrIntern.cpp +++ b/source/ps/CStrIntern.cpp @@ -113,7 +113,7 @@ static CStrInternInternals* GetString(const char* str, size_t len) return it->second.get(); shared_ptr internals(new CStrInternInternals(str, len)); - g_Strings.emplace(internals->data, internals); + g_Strings.insert(std::make_pair(internals->data, internals)); return internals.get(); } diff --git a/source/ps/ConfigDB.cpp b/source/ps/ConfigDB.cpp index 2d280f2d27..002dcd6550 100644 --- a/source/ps/ConfigDB.cpp +++ b/source/ps/ConfigDB.cpp @@ -184,7 +184,7 @@ void CConfigDB::SetValueString(EConfigNamespace ns, const CStr& name, const CStr CScopeLock s(&cfgdb_mutex); TConfigMap::iterator it = m_Map[ns].find(name); if (it == m_Map[ns].end()) - it = m_Map[ns].emplace_hint(m_Map[ns].begin(), name, CConfigValueSet(1)); + it = m_Map[ns].insert(m_Map[ns].begin(), make_pair(name, CConfigValueSet(1))); it->second[0] = value; } diff --git a/source/ps/KeyName.cpp b/source/ps/KeyName.cpp index e968f7ee08..059033978d 100644 --- a/source/ps/KeyName.cpp +++ b/source/ps/KeyName.cpp @@ -335,16 +335,16 @@ void InitKeyNameMap() { for (const SKeycodeMapping* it = keycodeMapping; it->keycode != 0; ++it) { - keymap.emplace(std::move(CStr(it->keyname).LowerCase()), it->keycode); - if (it->altkeyname) - keymap.emplace(std::move(CStr(it->altkeyname).LowerCase()), it->keycode); + keymap.insert(std::pair(CStr(it->keyname).LowerCase(), it->keycode)); + if(it->altkeyname) + keymap.insert(std::pair(CStr(it->altkeyname).LowerCase(), it->keycode)); } // Extra mouse buttons. for (int i = 1; i < 256; ++i) // There is no mouse 0 { - keymap.emplace("mousebutton" + CStr::FromInt(i), MOUSE_BASE + i); - keymap.emplace("mousen" + CStr::FromInt(i), MOUSE_BASE + i); + keymap.insert(std::pair("mousebutton" + CStr::FromInt(i), MOUSE_BASE + i)); + keymap.insert(std::pair("mousen" + CStr::FromInt(i), MOUSE_BASE + i)); } } diff --git a/source/ps/XML/Xeromyces.cpp b/source/ps/XML/Xeromyces.cpp index 28bb104d96..76818070ba 100644 --- a/source/ps/XML/Xeromyces.cpp +++ b/source/ps/XML/Xeromyces.cpp @@ -56,7 +56,7 @@ void CXeromyces::Startup() xmlInitParser(); xmlSetStructuredErrorFunc(NULL, &errorHandler); CScopeLock lock(g_ValidatorCacheLock); - g_ValidatorCache.emplace(std::string(), RelaxNGValidator()); + g_ValidatorCache.insert(std::make_pair(std::string(), RelaxNGValidator())); g_XeromycesStarted = true; } @@ -86,7 +86,7 @@ bool CXeromyces::AddValidator(const PIVFS& vfs, const std::string& name, const V std::map::iterator it = g_ValidatorCache.find(name); if (it != g_ValidatorCache.end()) g_ValidatorCache.erase(it); - g_ValidatorCache.emplace(name, validator); + g_ValidatorCache.insert(std::make_pair(name, validator)); } return true; } diff --git a/source/simulation2/serialization/SerializeTemplates.h b/source/simulation2/serialization/SerializeTemplates.h index 4ac08d7f0b..f9ec8c460c 100644 --- a/source/simulation2/serialization/SerializeTemplates.h +++ b/source/simulation2/serialization/SerializeTemplates.h @@ -94,7 +94,7 @@ struct SerializeMap V v; KS()(deserialize, "key", k); VS()(deserialize, "value", v); - value.emplace(k, v); + value.insert(std::make_pair(k, v)); } } @@ -112,7 +112,7 @@ struct SerializeMap V v; KS()(deserialize, "key", k); VS()(deserialize, "value", v, context); - value.emplace(k, v); + value.insert(std::make_pair(k, v)); } } }; diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp index 1915102420..52a5203109 100644 --- a/source/simulation2/system/ComponentManager.cpp +++ b/source/simulation2/system/ComponentManager.cpp @@ -544,7 +544,7 @@ void CComponentManager::RegisterComponentType(InterfaceId iid, ComponentTypeId c const char* name, const std::string& schema) { ComponentType c(CT_Native, iid, alloc, dealloc, name, schema, std::move(DefPersistentRooted())); - m_ComponentTypesById.emplace(cid, std::move(c)); + m_ComponentTypesById.insert(std::make_pair(cid, std::move(c))); m_ComponentTypeIdsByName[name] = cid; } @@ -552,7 +552,7 @@ void CComponentManager::RegisterComponentTypeScriptWrapper(InterfaceId iid, Comp DeallocFunc dealloc, const char* name, const std::string& schema) { ComponentType c(CT_ScriptWrapper, iid, alloc, dealloc, name, schema, std::move(DefPersistentRooted())); - m_ComponentTypesById.emplace(cid, std::move(c)); + m_ComponentTypesById.insert(std::make_pair(cid, std::move(c))); m_ComponentTypeIdsByName[name] = cid; // TODO: merge with RegisterComponentType } @@ -778,8 +778,8 @@ IComponent* CComponentManager::ConstructComponent(CEntityHandle ent, ComponentTy component->SetSimContext(m_SimContext); // Store a reference to the new component - emap1.emplace(ent.GetId(), component); - emap2.emplace(ent.GetId(), component); + emap1.insert(std::make_pair(ent.GetId(), component)); + emap2.insert(std::make_pair(ent.GetId(), component)); // TODO: We need to more careful about this - if an entity is constructed by a component // while we're iterating over all components, this will invalidate the iterators and everything // will break. @@ -801,7 +801,7 @@ void CComponentManager::AddMockComponent(CEntityHandle ent, InterfaceId iid, ICo boost::unordered_map& emap1 = m_ComponentsByInterface.at(iid); if (emap1.find(ent.GetId()) != emap1.end()) debug_warn(L"Multiple components for interface"); - emap1.emplace(ent.GetId(), &component); + emap1.insert(std::make_pair(ent.GetId(), &component)); SEntityComponentCache* cache = ent.GetComponentCache(); ENSURE(cache != NULL && iid < (int)cache->numInterfaces && cache->interfaces[iid] == NULL);