ENH: free/nullify of PtrList and UPtrList

- Allows clearing or freeing pointers without touching the underlying
  list size. Was previously only for PtrDynList, but now available on
  UPtrList, PtrList as well.

- add transfer() method to PtrDynList to avoid potential slicing.
This commit is contained in:
Mark Olesen
2023-05-10 14:02:13 +02:00
parent 139a8fc6ff
commit 62a68eeea0
15 changed files with 131 additions and 55 deletions

View File

@ -155,7 +155,7 @@ void Foam::sampledSets::gatherAllSets()
const PtrList<sampledSet>& localSets = *this;
gatheredSets_.clear();
gatheredSets_.free();
gatheredSets_.resize(localSets.size());
gatheredSorting_.resize_nocopy(localSets.size());
globalIndices_.resize_nocopy(localSets.size());