STYLE: compile-type deprecate empty() method for autoPtr/tmp (#1775)

- autoPtr: less clutter using plain tests with the bool operator

    (!ptr)  vs  (ptr.empty())
    (ptr)   vs  (!ptr.empty())

- tmp: was entirely unused.
This commit is contained in:
Mark Olesen
2020-07-16 09:51:51 +02:00
parent 35a0fd3e8e
commit fde93b6603
3 changed files with 14 additions and 5 deletions

View File

@ -140,9 +140,12 @@ public:
// Member Functions
// Check
// Query
//- True if the managed pointer is null
//- Deprecated(2020-07) True if the managed pointer is null
//
// \deprecated(2020-07) - use bool operator
FOAM_DEPRECATED_FOR(2020-07, "bool operator")
bool empty() const noexcept { return !ptr_; }
//- True if the managed pointer is non-null

View File

@ -49,7 +49,7 @@ See also
#include "refCount.H"
#include "word.H"
#include <utility>
#include "stdFoam.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -160,7 +160,10 @@ public:
// Query
//- True if a null pointer/reference
//- Deprecated(2020-07) True if a null managed pointer
//
// \deprecated(2020-07) - use bool operator
FOAM_DEPRECATED_FOR(2020-07, "bool operator")
bool empty() const noexcept { return !ptr_; }
//- True for non-null pointer/reference

View File

@ -139,7 +139,10 @@ public:
// Query
//- True if a null pointer/reference
//- Deprecated(2020-07) True if a null managed pointer
//
// \deprecated(2020-07) - use bool operator
FOAM_DEPRECATED_FOR(2020-07, "bool operator")
bool empty() const noexcept { return !ptr_; }
//- True for non-null pointer/reference