mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-18 19:47: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;
|
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;
|
||||||
/* --------------------------------------------------------------------------------------------
|
|
||||||
* 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;
|
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Retrieve an iterator to the beginning. See: std::vector::begin()
|
* Retrieve an iterator to the beginning. See: std::vector::begin()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user