diff --git a/src/OpenFOAM/memory/tmp/tmp.H b/src/OpenFOAM/memory/tmp/tmp.H index ebd8f676c953050bfd2a01046fce6bd3daa0d1d6..6369b5aa2be2af18ac89637bded5716dcd31c697 100644 --- a/src/OpenFOAM/memory/tmp/tmp.H +++ b/src/OpenFOAM/memory/tmp/tmp.H @@ -160,11 +160,11 @@ public: // Query - //- True if a null managed pointer - bool empty() const noexcept { return !ptr_ && type_ == PTR; } + //- True if a null pointer/reference + bool empty() const noexcept { return !ptr_; } - //- True for non-null managed pointer or an object reference - bool valid() const noexcept { return ptr_ || type_ == CREF; } + //- True for non-null pointer/reference + bool valid() const noexcept { return ptr_; } //- True if this is a managed pointer (not a reference) bool isTmp() const noexcept { return type_ == PTR; } @@ -241,8 +241,8 @@ public: // Fatal for a null managed pointer or if the object is const. inline T* operator->(); - //- Non-null managed pointer or an object reference : valid() - explicit operator bool() const noexcept { return ptr_ ||type_ == CREF; } + //- Non-null pointer/reference : valid() + explicit operator bool() const noexcept { return ptr_; } //- Transfer ownership of the managed pointer. // Fatal for a null managed pointer or if the object is const. diff --git a/src/OpenFOAM/memory/tmp/tmpNrc.H b/src/OpenFOAM/memory/tmp/tmpNrc.H index 037b2ab97df307ca544f0a2a1e9a67644dcfc1b2..5dc589e156dfd55883fe17fe6d1255a282bf2914 100644 --- a/src/OpenFOAM/memory/tmp/tmpNrc.H +++ b/src/OpenFOAM/memory/tmp/tmpNrc.H @@ -139,11 +139,11 @@ public: // Query - //- True if a null managed pointer - bool empty() const noexcept { return !ptr_ && type_ == PTR; } + //- True if a null pointer/reference + bool empty() const noexcept { return !ptr_; } - //- True for non-null managed pointer or an object reference - bool valid() const noexcept { return ptr_ || type_ == CREF; } + //- True for non-null pointer/reference + bool valid() const noexcept { return ptr_; } //- True if this is a managed pointer (not a reference) bool isTmp() const noexcept { return type_ == PTR; } @@ -220,8 +220,8 @@ public: // Fatal for a null managed pointer or if the object is const. inline T* operator->(); - //- Non-null managed pointer or an object reference : valid() - explicit operator bool() const noexcept { return ptr_ ||type_ == CREF; } + //- Non-null pointer/reference : valid() + explicit operator bool() const noexcept { return ptr_; } //- Transfer ownership of the managed pointer. // Fatal for a null managed pointer or if the object is const.