mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
This commit is contained in:
parent
6fa2ccb129
commit
e7c708d997
@ -54,18 +54,8 @@ template < class Key, class T, class Pred = std::equal_to< Key > > struct VecMap
|
||||
{
|
||||
if (e.first == key) return e.second;
|
||||
}
|
||||
return m_Storage.emplace_back(key, mapped_type{}).second;
|
||||
}
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Sub-script operator (const).
|
||||
*/
|
||||
const mapped_type & operator [] (const key_type & key) const
|
||||
{
|
||||
for (const auto & e : m_Storage)
|
||||
{
|
||||
if (e.first == key) return e.second;
|
||||
}
|
||||
return m_Storage.emplace_back(key, mapped_type{}).second;
|
||||
m_Storage.emplace_back(key, mapped_type{});
|
||||
return m_Storage.back().second;
|
||||
}
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve an iterator to the beginning. See: std::vector::begin()
|
||||
|
Loading…
Reference in New Issue
Block a user