UPtrList: Added append for consistency with PtrList

This commit is contained in:
Henry Weller
2023-11-10 20:42:01 +00:00
parent ee6f23ab57
commit ad1f953f6a
2 changed files with 12 additions and 0 deletions

View File

@ -128,6 +128,9 @@ public:
//- Clear the UPtrList, i.e. set size to zero
void clear();
//- Append an element at the end of the list
inline void append(T*);
//- Transfer the contents of the argument UPtrList into this
// UPtrList and annul the argument list
void transfer(UPtrList<T>&);

View File

@ -74,6 +74,15 @@ inline void Foam::UPtrList<T>::resize(const label newSize)
}
template<class T>
inline void Foam::UPtrList<T>::append(T* ptr)
{
label sz = this->size();
this->setSize(sz+1);
this->ptrs_[sz] = ptr;
}
template<class T>
inline bool Foam::UPtrList<T>::set(const label i) const
{