ENH: add refPtr release() method

- releases ownership of the pointer. A no-op (and returns nullptr)
  for references.

  Naming consistent with unique_ptr and autoPtr.

DOC: adjust wording for memory-related classes

- add is_const() method for tmp, refPtr.

  Drop (ununsed and confusing looking) isTmp method from refPtr
  in favour of is_pointer() or movable() checks

ENH: noexcept for some pTraits methods, remove redundant 'inline'

- test for const first for tmp/refPtr (simpler logic)
This commit is contained in:
Mark Olesen
2021-11-15 19:34:01 +01:00
parent 9c9d6c64b5
commit effd69a005
27 changed files with 241 additions and 196 deletions

View File

@ -39,6 +39,7 @@ Description
#include "argList.H"
#include "Time.H"
#include "IOobject.H"
#include "scalarField.H"
namespace Foam
{
@ -139,6 +140,8 @@ int main(int argc, char *argv[])
cout<<"PstreamBuffers:" << sizeof(Foam::PstreamBuffers) << nl;
cout<<"Time:" << sizeof(Foam::Time) << nl;
cout<<"tmp<>:" << sizeof(tmp<scalarField>) << nl;
Info << "---\nEnd\n" << endl;
return 0;