Add support for setting and taking ownership on a pointer in UniquePtrList.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
287b50fb2f
commit
5fda89bc72
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue