Add support for setting and taking ownership on a pointer in UniquePtrList.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -41,6 +41,15 @@ namespace ArbUt {
|
|||||||
#endif
|
#endif
|
||||||
return _vector[index];
|
return _vector[index];
|
||||||
}
|
}
|
||||||
|
ValueT* TakeOwnership(size_t index) {
|
||||||
|
auto p = _vector[index];
|
||||||
|
_vector[index] = nullptr;
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
void Set(size_t index, ValueT* ptr) {
|
||||||
|
delete _vector[index];
|
||||||
|
_vector[index] = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
inline void Remove(size_t index) {
|
inline void Remove(size_t index) {
|
||||||
#ifndef NO_ASSERT
|
#ifndef NO_ASSERT
|
||||||
|
|||||||
Reference in New Issue
Block a user