mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Update VecMap.hpp
This commit is contained in:
parent
66b2af9be2
commit
20cb308c3f
@ -189,10 +189,10 @@ template < class Key, class T, class Pred = std::equal_to< Key > > struct VecMap
|
|||||||
if (itr != m_Storage.end())
|
if (itr != m_Storage.end())
|
||||||
{
|
{
|
||||||
itr->second = mapped_type(std::forward< Args >(args)...);
|
itr->second = mapped_type(std::forward< Args >(args)...);
|
||||||
return *itr;
|
return itr->second;
|
||||||
}
|
}
|
||||||
m_Storage.emplace_back(k, std::forward< Args >(args)...);
|
m_Storage.emplace_back(k, std::forward< Args >(args)...);
|
||||||
return m_Storage.back();
|
return m_Storage.back().second;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
@ -204,10 +204,10 @@ template < class Key, class T, class Pred = std::equal_to< Key > > struct VecMap
|
|||||||
if (itr != m_Storage.end())
|
if (itr != m_Storage.end())
|
||||||
{
|
{
|
||||||
itr->second = mapped_type(std::forward< Args >(args)...);
|
itr->second = mapped_type(std::forward< Args >(args)...);
|
||||||
return *itr;
|
return itr->second;
|
||||||
}
|
}
|
||||||
m_Storage.emplace_back(std::move(k), std::forward< Args >(args)...);
|
m_Storage.emplace_back(std::move(k), std::forward< Args >(args)...);
|
||||||
return m_Storage.back();
|
return m_Storage.back().second;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user