STYLE: can add compile-time deprecated message for autoPtr::set()

- deprecated Feb-2018, but not marked as such.

  The set() method originally enforce an additional run-time check
  (Fatal if pointer was already set), but this was rarely used.
  In fact, the set() method was invariably used in constructors
  where the pointer by definition was unset.

  Can now mark as deprecated to catch the last of these.
  We prefer reset() for similarity with std::unique_ptr

  Eg,
  FOAM_EXTRA_CXXFLAGS="-DFoam_autoPtr_deprecate_setMethod"  wmake
This commit is contained in:
Mark Olesen
2020-11-19 12:40:47 +01:00
parent 07bbae0c55
commit 6e3bc1f7d0
13 changed files with 61 additions and 39 deletions

View File

@ -88,9 +88,9 @@ Foam::functionObjects::columnAverage::meshAddressing(const polyMesh& mesh) const
mesh.points()
);
globalFaces_.set(new globalIndex(uip.size()));
globalEdges_.set(new globalIndex(uip.nEdges()));
globalPoints_.set(new globalIndex(uip.nPoints()));
globalFaces_.reset(new globalIndex(uip.size()));
globalEdges_.reset(new globalIndex(uip.nEdges()));
globalPoints_.reset(new globalIndex(uip.nPoints()));
meshStructurePtr_.reset
(
new meshStructure

View File

@ -85,8 +85,8 @@ bool Foam::functionObjects::surfaceDistance::read
doCells_ = dict.getOrDefault("calculateCells", true);
geomPtr_.clear();
geomPtr_.set
geomPtr_.reset(nullptr);
geomPtr_.reset
(
new searchableSurfaces
(