ENH: additional PtrList constructor and memory management method

- PtrList::release() method.

  Similar to autoPtr and unique_ptr and clearer in purpose than
  using set(i,nullptr)

- Construct from List of pointers, taking ownership.

  Useful when upgrading code. Eg,

     List<polyPatch*> oldList = ...;
     PtrList<polyPatch> newList(oldList);
     ...

BUG: incorrect resizing method names (PtrDynList) in previously unused code
This commit is contained in:
Mark Olesen
2019-02-22 15:55:17 +01:00
parent f0ff7627b1
commit b5e4924eec
8 changed files with 161 additions and 21 deletions

View File

@ -391,7 +391,7 @@ bool Foam::sampledSurfaces::read(const dictionary& dict)
{
const dictionary& surfDict = capture[inputi];
autoPtr<sampledSurface> surf = input.set(inputi, nullptr);
autoPtr<sampledSurface> surf = input.release(inputi);
if (!surf.valid() || !surf->enabled())
{