openfoam/applications
Mark Olesen 63258d0b33 ENH: refine PtrList emplace method, add emplace for autoPtr/refPtr...
* resize_null() methods for PtrList variants
  - for cases where an existing PtrList needs a specific size and
    but not retain any existing entries.

    Eg,
        ptrs.resize_null(100);

    vs.   ptrs.free();     ptr.resize(100);
    or    ptr.resize(100); ptrs.free();

* remove stored pointer before emplacing PtrList elements
  - may reduce memory peaks

* STYLE: static_cast of (nullptr) instead of reinterpret_cast of (0)

* COMP: implement emplace_set() for PtrDynList
  - previously missing, which meant it would have leaked through to the
    underlying PtrList definition

* emplace methods for autoPtr, refPtr, tmp
  - applies reset() with forwarding arguments.
    For example,

        tmp<GeoField> tfld = ...;

    later...

        tfld.emplace(io, mesh);

    vs.
        tfld.reset(new GeoField(io, mesh));
    or
        tfld.reset(tmp<GeoField>::New(io, mesh));

    The emplace() obviously has reduced typing, but also allows the
    existing stored pointer to be deleted *before* creating its
    replacement (reduces memory peaks).
2023-07-27 16:52:03 +02:00
..
solvers STYLE: changes to Time and TimeState 2023-07-04 17:25:25 +02:00
test ENH: refine PtrList emplace method, add emplace for autoPtr/refPtr... 2023-07-27 16:52:03 +02:00
tools ENH: support field width for #eval expressions 2021-03-29 16:00:11 +02:00
utilities STYLE: use 'is_sorted()' instead of 'sorted()' for readers, Pair, ... 2023-07-19 14:10:31 +02:00
Allwmake COMP: increment lemon sources, fix stray comment char (wmkdepend) 2022-05-11 09:53:58 +02:00