mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Update Utilities.hpp
This commit is contained in:
parent
62b9504d43
commit
cae745378d
@ -169,7 +169,21 @@ template < class T, class W > struct DpVectorProxy
|
|||||||
// Return the object from the cache
|
// Return the object from the cache
|
||||||
return mVec[static_cast< size_t >(i)].first;
|
return mVec[static_cast< size_t >(i)].first;
|
||||||
}
|
}
|
||||||
SQMOD_NODISCARD LightObj & Get(SQInteger i) { ValidIdx_(i); return Get_(i); }
|
SQMOD_NODISCARD LightObj & Get(SQInteger i)
|
||||||
|
{
|
||||||
|
// Was the referenced vector modified?
|
||||||
|
if (mVec.size() < Valid().size())
|
||||||
|
{
|
||||||
|
// Synchronize the size
|
||||||
|
mVec.resize(mPtr->size());
|
||||||
|
// Synchronize the cache
|
||||||
|
CacheSync();
|
||||||
|
}
|
||||||
|
// Validate index
|
||||||
|
ValidIdx_(i);
|
||||||
|
// Perform the request
|
||||||
|
return Get_(i);
|
||||||
|
}
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Modify a value from the container.
|
* Modify a value from the container.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user